2010-04-21 59 views
1

我正在努力使open_id_authentication插件正常工作。
最初是用authlogic做的,但放弃了,因为它感觉像更多的麻烦帮助。open_id_authentication - “OpenIdAuthentication.store为零。使用内存中的存储。”问题

问题是我在日志中得到OpenIdAuthentication.store is nil. Using in-memory store.警告,这会阻止正确验证用户身份。

这里是日志片段:

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 

我真的不知道我有什么为了解决这个问题做。可能将商店设置为数据库(并且我有OpenID迁移)。也不知道我是否真的需要数据库来执行OpenID身份验证。

原来的项目(分店)是here,所以你可以近距离观察。

希望对此有好的建议。

谢谢,
德米特里。

回答

3

我遇到了类似的问题,最近的open_id插件和内存存储。一些OpenID网站可以工作,但大多数不会。 MemoryStore中的某些内容在如何进行身份验证时被破坏。切换到使用文件存储为我工作得很好。

我创建了这里面名为config/initializers/openid.rb一个初始化:

OpenIdAuthentication.store = :file 

重新启动应用程序,我想尽OpenID的URL开始工作。

为什么File存储在Memory存储没有时工作,我无法回答。我只知道这为我修好了。

+1

基于文件的商店存储只适用于具有单个应用程序服务器的情况。并不安全。所以我需要有数据库存储。 – 2010-04-21 22:27:22

+0

如何使用先前版本的插件 - 在他们移除数据库存储之前?有一个完整的副本,包含在openid/authlogic插件中: http://github.com/binarylogic/authlogic_openid/tree/master/test/libs/open_id_authentication/ 这应该包括用于设置数据库的rake任务。也许。 – 2010-04-21 23:07:32

+0

我摆脱了authlogic,并使用普通的'open_id_authentication'来自rails。它仍然不适用于数据库商店。认为它使用':file'。 – 2010-04-28 00:34:40