500 Error in LinkedIn Oauth2 Workflow
See original GitHub issueI’m trying to integrate python-social-auth into a Django site so users can login via LinkedIn. I’ve followed the instructions (I hope correctly) and my app correctly sends the user off to LinkedIn to authorise the login.
Once authorised LinkedIn bounces the user back to https://my-site/complete/linkedin-oauth2/?code=...
, and social-auth calls https://api.linkedin.com/v1/people/~:(first-name,id,last-name)?format=json
to try and get some data for the user.
At this point LinkedIn returns a 500 error. social-auth throws the exception requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.linkedin.com/v1/people/~:(first-name,id,last-name)?format=json
.
I’ve tried dialing up the logging on social/requests/httplib to DEBUG so all the headers are printed, and while I’m no oauth expert they look appropriate. I wonder if this is a bug at LinkedIn’s end but I’m hesitant to file a report until I know others are running into the same thing.
I’m running:
$ pip freeze | grep social
python-social-auth==0.3.6
social-auth-app-django==2.1.0
social-auth-core==1.6.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top GitHub Comments
thank you, eoinof ! I’ve pinned social-auth-core==1.5.0 and it works now
when I “didn’t change anything”, I rebuilt docker container and they have in social-app-django/requirements.txt social-auth-core >= 1.2.0 so I’ve got 1.6.0 after having 1.5.0 and that broke linkedin
I’ve tried to play around the version from the above pull request in my project using social-auth-core, and it seems to work. Thank you @bisby for finding the solution.