试图让用户登录/注册Twitter和Facebook。 Twitter的作品没有问题,但Facebook的策略不同。无法使用Facebook进行身份验证:OAuth2的未定义方法“web_server”?
undefined method `web_server' for #<OAuth2::Client:0x00000005211d58>
跟踪显示
oa-oauth (0.0.1) lib/omniauth/strategies/oauth2.rb:18:in `request_phase'
oa-oauth (0.0.1) lib/omniauth/strategies/facebook.rb:28:in `request_phase'
oa-core (0.0.5) lib/omniauth/strategy.rb:25:in `call!'
oa-core (0.0.5) lib/omniauth/strategy.rb:19:in `call'
oa-core (0.0.5) lib/omniauth/builder.rb:22:in `call'
warden (1.0.5) lib/warden/manager.rb:35:in `block in call'
warden (1.0.5) lib/warden/manager.rb:34:in `catch'
warden (1.0.5) lib/warden/manager.rb:34:in `call'
别人的经验?
ps。我使用下面的宝石:
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'oauth2'
我不使用全omniauth宝石作为其可寻址的依赖与其他宝石冲突。
什么版本的oauth2您使用的是?据我所知,由于oauth2规格的变化速度很快,所以更新速度非常快。当我使用试图使用oauth2版本0.5.0 –
的魔法宝石时,我遇到同样的问题我目前使用Oauth2 0.4.1 – digitalWestie