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.
- Implement the LinkedIn login settings and views
- Set scopes as the following: SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = ['openid', 'profile', 'email']
- Try to log in
- 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
- A log in page from LinkedIn should appear now, enter credentials and press the sign in button
- 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'
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.
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'