加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Rails Omniauth for Linkedin无法正常工作

发布时间:2020-12-16 23:00:52 所属栏目:百科 来源:网络整理
导读:我正试图通过Omniauth使用Devise,Omniauth和 omniauth-linkedin-oauth-2来获取Linkedin访问令牌.无论是使用facebook还是twitter,我都可以获得访问令牌,但是当我尝试使用linkedin时,我会收到以下错误omn??iauth回调: ERROR -- omniauth: (linkedin) Authenti
我正试图通过Omniauth使用Devise,Omniauth和 omniauth-linkedin-oauth-2来获取Linkedin访问令牌.无论是使用facebook还是twitter,我都可以获得访问令牌,但是当我尝试使用linkedin时,我会收到以下错误omn??iauth回调:
ERROR -- omniauth: (linkedin) Authentication failure! invalid_credentials: OAuth2::Error,invalid_request: missing required parameters,includes an invalid parameter value,parameter more than once. : Unable to retrieve access token : appId or redirect uri does not match authorization code or authorization code expired
{"error_description":"missing required parameters,parameter more than once. : Unable to retrieve access token : appId or redirect uri does not match authorization code or authorization code expired","error":"invalid_request"}

linkedin应用程序ID和秘密身份验证正在工作,因为我在omniauth上收到回调,事情是我无法意识到问题在这里.

下面的设计配置:

config.omniauth :linkedin,ENV['LINKEDIN_APP_ID'],ENV['LINKEDIN_APP_SECRET']

关于可能发生什么的任何想法?

解决方法

我有同样的问题,我找到了解决这个问题的方法.
在你的Gemfile中放这个:
#Contains a generic OAuth2 strategy for OmniAuth
gem 'omniauth-oauth2','~> 1.3.1'

最后做:

bundle update

我认为它应该有效.

更多信息:
https://github.com/intridea/omniauth-oauth2/issues/81

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读