Anoop Valluthadam
Anoop Valluthadam

Reputation: 109

linkedin oauth authorization fails with "Bummer, something went wrong"

Bummer, something went wrong

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=test&redirect_uri=http://test.custom.com/abc/linkedin&state=DCEeFWf45A53sdfKef424asgTyhgTR5

when I use the above url I am getting "Bummer, something went wrong. We're having difficulty connecting."

Upvotes: 8

Views: 22673

Answers (8)

Muhammad Zohaib
Muhammad Zohaib

Reputation: 3

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=${process.env.REACT_APP_LinkedInClientID}&redirect_uri=${process.env.REACT_APP_MY_URL}/linkcheck&state=foobar&scope=profile%20email

Changing scope name to 'profile' and 'email' worked for me

Upvotes: 0

Pooya Chavoshi
Pooya Chavoshi

Reputation: 495

scope parameters format are changed from:

scope=liteprofile%20emailaddress%20w_member_social

to

scope=openid+profile+w_member_social+email

unfortunately, LinkedIn did not mention this in developer API documentation. this is the correct request sample:

https://www.linkedin.com/oauth/v2/authorization?
response_type=code&
client_id=client_id&
redirect_uri=redirect&
state=foobar&
scope=openid+profile+w_member_social+email

Upvotes: 4

Hassan Elshazly Eida
Hassan Elshazly Eida

Reputation: 859

LinkedIn has deprecated that old authentication, now you need to use the OpenID connect product, for that you need to use linkedin-openid in the route instead of linkedin:

From: http://localhost:8000/linkedin/callback
To: http://localhost:8000/linkedin-openid/callback

also don't forget to request access for "Sign In with LinkedIn using OpenID Connect" product

enter image description here

Upvotes: 1

SyraKozZ
SyraKozZ

Reputation: 659

You need to add the "Sign In with LinkedIn" permission.

  • Go to your app page
  • Go to the products tab (for your app, not at the top; there are two)
  • Select "Request Access" on the "Sign In with LinkedIn" product and the "Share on LinkedIn" product. This will give access to the following permissions: r_emailaddress, r_liteprofile, w_member_social.

Upvotes: 17

bormat
bormat

Reputation: 1379

The best is to inspect how is the link generated by linkedin developer tool for you and then you just have to change the redirect url

https://www.linkedin.com/developers/tools/oauth

then "create token" then select all permission and click on "Request access token" if you have the development window open you can see a query authorisation is done, then you can just copy this url and change the redirect_url.

enter image description here]1

so for me https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=myclientid&redirect_uri=myredirectid&scope=r_emailaddress%2Cr_liteprofile%2Cw_member_social&state=e6c0e1c8-1a35-478f-8eea-b0412a6675c9

Upvotes: 2

cppRohit
cppRohit

Reputation: 27

I ran into same issue.

Changing value of redirect_uri in linkedin app from http to https helped solved the issue. See picture below:

Linkedin App OAuth 2.0 Settings


In your case, url should have been:

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=test&redirect_uri=https://test.custom.com/abc/linkedin&state=DCEeFWf45A53sdfKef424asgTyhgTR5 ;

Upvotes: -1

SayoPaul
SayoPaul

Reputation: 173

Hello I had a similar problem and I fixed it by doing this ;

You have to ensure that everything in your APP page ( https://www.linkedin.com/developer/apps ) matches the parameters in your authorization URL . SO for example in your case , https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=test&redirect_uri=http://test.custom.com/abc/linkedin&state=DCEeFWf45A53sdfKef424asgTyhgTR5 ;

You would have to ensure that your client_id in the auth URL matches the Client-Id on your APP page and also ensure that the redirect_uri you specified in your auth URL has been authorized on your app page as shown below . If you are passing in scopes as well, also ensure that they match perfectly . As you can see in the image below , my redirect_uri has been authorized from my app page . enter image description here

Upvotes: 8

Samuel Leblond
Samuel Leblond

Reputation: 11

Recreate a application after 12/15/2018 solved the problem for me. (Any developer application created through the LinkedIn Developer Portal after December 15, 2018 automatically has access to the v2 API.) https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context

Upvotes: 1

Related Questions