Question

I'm using django application with python-social-auth responsible for integration with Linkedin OAuth2 API.

Linkedin returns 500 server error:

{
    "error":"server_error",
    "error_description":"the authorization server encountered an unexpected condition : Unable to retrieve access token"
}

Steps to reproduce:

  1. Create new LinkedIn app with OAuth 2.0 Redirect URLs set to http://localhost/complete/linkedin-oauth2/?
  2. Setup django app with python-social-auth module:

    SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY = <API key>
    SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET = <Secret Key>
    
  3. Run Django server on port 80 and go to: http://localhost/login/linkedin-oauth2/

  4. Go to Linkedin Settings, choose Groups, Companies & Applications > View your applications, select your application name and submit Remove
  5. Logout user from your Django app and start authentication again: http://localhost/login/linkedin-oauth2/
Was it helpful?

Solution

There's a discussion about this issue on the LinkedIn forums.

Apparently this can happen if you move from OAuth1 to OAuth2.

The proposed remedy until they resolve the problem is to create a new authentication key for our applications.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top