Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkedIn Login not working, needs to be updated #860

Open
ed-zitle opened this issue Nov 17, 2023 · 2 comments · May be fixed by #915
Open

LinkedIn Login not working, needs to be updated #860

ed-zitle opened this issue Nov 17, 2023 · 2 comments · May be fixed by #915

Comments

@ed-zitle
Copy link

ed-zitle commented Nov 17, 2023

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'

@noxan
Copy link
Contributor

noxan commented Nov 22, 2023

@ed-zitle did you check out #833? it was shipped with the latest version, documentation is coming soon (works like any other openid connect backend). also it only works with the current development version (as it needs 8fed29b).

@nijel
Copy link
Member

nijel commented Jun 25, 2024

#915 most likely addresses this issue, review wanted.

@nijel nijel linked a pull request Jun 25, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants