Linkedin oauth2 r_liteprofile not being returned from api

陌路散爱 提交于 2019-12-11 04:45:34

问题


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.


回答1:


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://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context

All new applications created on the LinkedIn Developer Platform as of January 14, 2019 can use LinkedIn's v2 APIs.

Specifically...

What permissions do I have access to?

LinkedIn v1 APIs provided the following set of permissions:

r_basicprofile r_emailaddress w_share rw_company_admin

Moving forward, the available v2 APIs include:

r_liteprofile (replaces r_basicprofile) r_emailaddress w_member_social (replaces w_share)

and ...

Looking to maintain access to the Basic Profile fields? Learn more about applying to a LinkedIn Partner Program.



来源:https://stackoverflow.com/questions/54178931/linkedin-oauth2-r-liteprofile-not-being-returned-from-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!