所以我有一个 rails 应用程序,我正在将此 gem 用于 oauth2。现在在linkedin的开发者控制台上我只能选择
r_basicprofile
, r_emailaddress
,rw_company_admin
和w_share
.
所以我r_basicprofile
选择了。
现在一旦确定linkedin在推动用户http://localhost:3000/auth/linkedin/callback?error=unauthorized_scope_error&error_description=Scope+%26quot%3Br_liteprofile%26quot%3B+is+not+authorized+for+your+application&state=126bb5cb16613e67f77580954980f86e4a3080c7cb4e56fe
这显然是要求r_liteprofile
。现在因为r_liteprofile
不允许它给出一个回调错误
OmniAuth::Strategies::OAuth2::CallbackError
unauthorized_scope_error | Scope "r_liteprofile" is not authorized for your application
.
routes.rb 看起来像
get 'login-linkedin', to: redirect('/auth/linkedin')
get 'auth/:provider/callback', to: 'sessions#identify_network_entry'
omniauth.rb 看起来像
provider :linkedin, 'KEY', 'VALUE
Oauth2.0 的linkedin 控制台中的回调 url 看起来像
http://localhost:3000/auth/linkedin/callback
是否有解决方法或者这是一个实施缺陷?这不再偶尔发生,所以我假设我正在犯一个实施错误。