Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 打开“身份验证-”;OpenIdAuthentication.store为零。使用内存存储。”;问题_Ruby On Rails_Ruby_Authentication_Openid - Fatal编程技术网

Ruby on rails 打开“身份验证-”;OpenIdAuthentication.store为零。使用内存存储。”;问题

Ruby on rails 打开“身份验证-”;OpenIdAuthentication.store为零。使用内存存储。”;问题,ruby-on-rails,ruby,authentication,openid,Ruby On Rails,Ruby,Authentication,Openid,我正在努力使插件正常工作。 最初是用authlogic来做的,但后来被放弃了,因为它让人觉得需要更多的帮助 问题是我得到的OpenIdAuthentication.store是nil。使用内存存储。日志中出现警告,阻止正确验证用户 以下是日志片段: Processing UserSessionsController#create (for 127.0.0.1 at 2010-04-21 23:58:38) [POST] Parameters: {"commit"=>"Sign in",

我正在努力使插件正常工作。
最初是用authlogic来做的,但后来被放弃了,因为它让人觉得需要更多的帮助

问题是我得到的
OpenIdAuthentication.store是nil。使用内存存储。
日志中出现警告,阻止正确验证用户

以下是日志片段:

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身份验证

最初的项目(分支)是这样的,你可以仔细看看

如果你能给我一些好的建议,我将不胜感激

谢谢,

Dmitry.

最近的OpenID插件和内存存储也有类似的问题。一些OpenID站点可以工作,但大多数不能。MemoryStore中的某些内容在如何进行身份验证方面被破坏。切换到使用文件存储对我来说很好

我创建了一个名为
config/initializers/openid.rb
的初始值设定项,其中包含以下内容:

OpenIdAuthentication.store = :file
重新启动应用程序,我尝试的每个openId URL都开始工作


为什么文件存储可以工作而内存存储不能,我无法回答。我只知道这为我解决了这个问题。

基于文件的存储只有在只有一台应用服务器的情况下才有效。而且使用起来也不安全。所以我需要数据库存储。在他们删除数据库存储之前,使用以前版本的插件怎么样?openid/authlogic插件中包含了一个完整的副本:它应该包含用于设置数据库的rake任务。也许吧。我摆脱了authlogic,使用rails提供的普通
open\u id\u身份验证
。它仍然不能与数据库存储一起工作。虽然它与
:file
有关。