views:

184

answers:

1

Hi,

I am trying to make the open_id_authentication plugin working.
Initially was doing it with authlogic but abandoned because it feels like much more hassle the help.

The problem is that I am getting OpenIdAuthentication.store is nil. Using in-memory store. warning in the log which prevents from authenticating users correctly.

Here is the log snippet:

Processing UserSessionsController#create (for 127.0.0.1 at 2010-04-21 23:58:38) [POST]
  Parameters: {"commit"=>"Sign in", "authenticity_token"=>"MSPc+VMgsQZ/w7vsb2OiE0azsF1QmphZqfnS6cPRD/U=", "openid_identifier"=>"http://myopenid.com"}
Completed in 12ms (View: 1, DB: 0) | 401 Unauthorized [http://localhost/user_session]
Generated checkid_setup request to http://www.myopenid.com/server with assocication {HMAC-SHA1}{4bcf0490}{MN9AXg==}
OpenIdAuthentication.store is nil. Using in-memory store.
Error attempting to use stored discovery information: OpenID::TypeURIMismatch
Attempting discovery to verify endpoint
Performing discovery on http://xxx.myopenid.com/
Using 'check_authentication' with http://www.myopenid.com/server

I am not really sure what I have to do in order to fix this issue. Probably setting the store to database (and I have OpenID migration). Also not sure if I really need the database to perform the OpenID authentication.

The original project (branch) is here so you can have a close look.

Would appreciate good advices on that.

Thanks,
Dmitriy.

+1  A: 

I was having similar problems with the most recent open_id plugin and the memory store. Some OpenID sites would work, but most would not. Something in the MemoryStore is broken on how to authenticate. Switching to using the file store worked fine for me.

I created a initializer named config/initializers/openid.rb with this inside:

OpenIdAuthentication.store = :file

Restarted the app, and every openId URL I tried started working.

Why the File store works when the Memory store doesn't, I can't answer. I just know that this fixed it for me.

Bill Turner
The file based store store only works if you have a single application server. And it's not safe to use. So I need to have database store.
Dmytrii Nagirniak
How about using a previous version of the plugin - before they removed the DB store? There's a full copy, included in the openid/authlogic plugin:http://github.com/binarylogic/authlogic_openid/tree/master/test/libs/open_id_authentication/That should include the rake tasks for setting up the DB. Maybe.
Bill Turner
I got rid of authlogic and use plain `open_id_authentication` from rails. It still doesn't work with the DB store. Thought it does with `:file`.
Dmytrii Nagirniak