social-app-django
social-app-django copied to clipboard
LinkedIn OAuth2 Problem
Problem with LinkedIn OAuth2 After authentication show this error message
HTTPError at /oauth/complete/linkedin-oauth2/ 410 Client Error: Gone for url: https://api.linkedin.com/v1/people/~:(email-address,first-name,headline,id,industry,last-name)?format=json
Django settings conf Add email to requested authorizations. SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = ['r_emailaddress', 'r_liteprofile'] Add the fields so they will be requested from linkedin. SOCIAL_AUTH_LINKEDIN_OAUTH2_FIELD_SELECTORS = [ 'email-address', 'headline', 'industry', ]
social-auth-app-django==3.1.0 social-auth-core==2.0.0 Django==2.1
I'm also facing the same issue...If you resolved it please let me know.
same here
same problem
It was working previously, since last week its started throwing this error.
+1 Just got this error here. Anyone found a solution?
The PyPi version for social-auth-core seems to be behind master from Github, which references v2. This worked for me:
pip uninstall social-auth-core
pip install git+https://github.com/python-social-auth/social-core
The PyPi version for
social-auth-coreseems to be behind master from Github, which references v2. This worked for me:
pip uninstall social-auth-corepip install git+https://github.com/python-social-auth/social-core
Perfect! Works for us
new error came😖
On Tue, 21 May 2019 at 22:53, Amrit Saini [email protected] wrote:
The PyPi version for social-auth-core seems to be behind master from Github, which references v2. This worked for me:
pip uninstall social-auth-core pip install git+https://github.com/python-social-auth/social-core
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/python-social-auth/social-app-django/issues/182?email_source=notifications&email_token=ALWKCHPELJJNKXOU2QUEG3DPWQV2TA5CNFSM4GKSGC6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV4TKIY#issuecomment-494482723, or mute the thread https://github.com/notifications/unsubscribe-auth/ALWKCHIZKDS4IAFTDVZYRE3PWQV2TANCNFSM4GKSGC6A .
I'm experiencing the same issue and it seems to be a recent bug.
@Amrit0991 following your suggestion I was able to resolve the 500 error that was being returned previously but now the auth process just redirects to my SOCIAL_AUTH_LOGIN_ERROR_URL and I see Authentication process canceled in the server console. My other authentication backends continue to work as before.
Any thoughts/suggestions?
I'm experiencing the same issue and it seems to be a recent bug.
@Amrit0991 following your suggestion I was able to resolve the 500 error that was being returned previously but now the auth process just redirects to my
SOCIAL_AUTH_LOGIN_ERROR_URLand I seeAuthentication process canceledin the server console. My other authentication backends continue to work as before.Any thoughts/suggestions?
For me it worked only for new users. Existing users had to be removed. Looking for a migration path right now
As of May 1, 2019, LinkedIn has stopped support for v1 API. The LinkedInOauth2 class in social-auth-core is updated to use v2 API, and the changes are merged to master. Like @Amrit0991 mentioned, the Pypi version is behind the master.
It should solve a lot of issues for most of us.
pip uninstall social-auth-core
pip install git+https://github.com/python-social-auth/social-core
Also, as per the new permission "r_liteprofile", only firstName, lastName, Email and ProfilePictureUrl is available. By default, the LinkedinOauth2 backend on social-auth-core do not support ProfilePictureUrl, but if you are interested, please check this gist.
NOTE:
- Use
emailAddressinstead ofemail-address. Avoid usingindustry,headline. - If you are facing issue on the production Django app, copy the Client Id and Client Secret of the prod app and use them on your local dev environment. Mark
Debug=Falseinsettings.py. You will know the exact error instead of a generic messageAuthentication process canceled. This message is added by social-auth-core to throw a 400 instead of 500 on a production app. - As of May 2019, you must add "Product" for LinkedIn App. Check the screenshot and if "Singin with Linkedin" is not listed under "Added Product", please add it using "Add more products" button.

Please share the error messages.
@awachat works for me. (Still having problems on heroku, but seems to be a heroku issue)
@awachat works for me. (Still having problems on Heroku, but seems to be a Heroku issue)
heroku does not allow hot patching libs during releasing. Thus I had to change the Pipfile. However, to force an update on social-auth-core I had to bump the version number
social-auth-app-django = "*"
social-auth-core = {version = ">=3.1.1", git = "https://github.com/tuergeist/social-core.git"}
Furthermore, Heroku's caches shall be cleaned: https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache
$ heroku plugins:install heroku-repo
$ heroku repo:purge_cache -a appname
$ git commit --allow-empty -m "Purge cache"
$ git push # or git push heroku master
Hi @SebasWilde
The solution is using:
Django>=2.2 djangorestframework==3.10.1 social-auth-core==3.2.0 social-auth-app-django==3.1.0