So I have a rails app and I am using this gem for oauth2. Now on the developer's console on linkedin I can only select
r_basicprofile
, r_emailaddress
, rw_company_admin
and w_share
.
So I have r_basicprofile
selected.
Now once identified linkedin in pushing the user to 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
which is clearly requesting r_liteprofile
. Now since r_liteprofile
is not allowed it gives a callback error
OmniAuth::Strategies::OAuth2::CallbackError
unauthorized_scope_error | Scope "r_liteprofile" is not authorized for your application
.
routes.rb looks like
get 'login-linkedin', to: redirect('/auth/linkedin')
get 'auth/:provider/callback', to: 'sessions#identify_network_entry'
omniauth.rb looks like
provider :linkedin, 'KEY', 'VALUE
callback url in linkedin console for Oauth2.0 looks like
http://localhost:3000/auth/linkedin/callback
Is there a workaround or is this an implementation flaw ? This stopped happening sporadically so I am assuming I'm making an implementation error.
Today (jan 14th) linkedin transitioned their docs and allowed for all applications created after today to automatically be able to use r_liteprofile under the self serve section, but to use the r_basicprofile you'll have to apply to their partner program.
Connecting to the v1 API with r_basicprofile should work, but only until march 1st.
Perhaps your issue was happening because of the switch that took place.
Read more here:
https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context
Specifically...
and ...