Omniauth OpenId 身份验证在 user_info 上返回 nil
我正在使用 Ruby 1.9.2 + Rails 3 + Devise + Omniauth 并尝试使用 Openid 对用户进行身份验证。
我在omniauth.rb 上的提供程序
provider :open_id, OpenID::Store::Filesystem.new('/tmp')
provider :open_id, OpenID::Store::Filesystem.new('/tmp'),
{:name => "google", :identifier => "https://www.google.com/accounts/o8/id" }
provider :open_id, OpenID::Store::Filesystem.new('/tmp'),
{:name => "yahoo", :identifier => "https://me.yahoo.com" }
被正确重定向到提供程序并调用回调。但是对于 myopenid,它总是在 user_info
哈希上返回 nil。对于 google 或 yahoo,当调用回调 url 时,它会返回 400(错误请求)。
对于谷歌和雅虎,我添加了 :required =>; []
param(不太确定 id 的作用)并且它没有返回 400 错误,但 user_info
再次为零
I am using Ruby 1.9.2 + Rails 3 + Devise + Omniauth and trying to authenticate users with Openid.
My providers on omniauth.rb are
provider :open_id, OpenID::Store::Filesystem.new('/tmp')
provider :open_id, OpenID::Store::Filesystem.new('/tmp'),
{:name => "google", :identifier => "https://www.google.com/accounts/o8/id" }
provider :open_id, OpenID::Store::Filesystem.new('/tmp'),
{:name => "yahoo", :identifier => "https://me.yahoo.com" }
I am redirected correctly to the providers and callback is called. However for myopenid, it always returns nil on the user_info
hash. And for both google or yahoo it returns a 400 (Bad Request) when the callback url is called.
For google and yahoo, I added :required => []
param (not really sure what id does) and it didnt return the 400 error, but again user_info
was nil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是权限。尝试将 ('tmp') 更改为 ('./tmp')
It could be permissions. Try Changing ('tmp') to ('./tmp')