open_id_authentication - “OpenIdAuthentication.store is nil. Using in-memory store.” problem

对着背影说爱祢 提交于 2019-11-28 10:40:18

问题


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:


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.



来源:https://stackoverflow.com/questions/2683611/open-id-authentication-openidauthentication-store-is-nil-using-in-memory-sto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!