Skip to content

LinkedIn Login not working, needs to be updated #860

Description

@ed-zitle

Expected behaviour

Should get the profile information from a LinkedIn logged in user using OAuth2

Actual behaviour

Despite changing the scopes in settings.py, the social-auth app automatically adds the 'r_liteprofile' scope which causes an error when trying to send the request via URL, if that scope is removed from the URL to work around this, the social-auth app tries to connect to a deprecated endpoint 'v2/me/'.

What are the steps to reproduce this issue?

Input clear steps to reproduce the issue for a maintainer.

  1. Implement the LinkedIn login settings and views
  2. Set scopes as the following: SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = ['openid', 'profile', 'email']
  3. Try to log in
  4. Remove 'r_liteprofile' from the URL: https://www.linkedin.com/oauth/v2/authorization?client_id=APPID&redirect_uri=http://127.0.0.1:8000/social-auth/complete/linkedin-oauth2/&state=H4ziRDKMAtoQ1TlMiMJn6kdhTwnHfT42&response_type=code&scope=openid+profile+email+r_liteprofile
  5. A log in page from LinkedIn should appear now, enter credentials and press the sign in button
  6. A Django error screen pops up

Any logs, error output, etc?

The Django error screen says the following:

HTTPError at /social-auth/complete/linkedin-oauth2/
403 Client Error: Forbidden for url: https://api.linkedin.com/v2/me?projection=(firstName,id,lastName)

Any other comments?

The new endpoint to update to is '/v2/userinfo'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions