python-social-auth / social-core

Python Social Auth - Core
BSD 3-Clause "New" or "Revised" License
837 stars 543 forks source link

Linkedin OAuth dont work due new Linkedin scopes. #922

Open arielespinosa opened 1 week ago

arielespinosa commented 1 week ago

Expected behaviour

User can login with Linkedin using OAuth2

Actual behaviour

Got an error due Linkedin scopes

What are the steps to reproduce this issue?

  1. Setup the Django app as documentation.
  2. Linkedin -> ref to login with Linkedin
  3. url path: path('social-auth/', include('social_django.urls', namespace='social')),

Any logs, error output, etc?

Authentication failed: Scope "r_liteprofile" is not authorized for your application

Any other comments?

The issue is due DEFAULT_SCOPE = ["r_liteprofile"] in LinkedinOAuth2 backend class. As soon you remove de defaul value, it's works. Guess the best is use new default values, but, if user define SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE settings's var, change DEFAULT_SCOPE value.

nijel commented 6 days ago

https://github.com/python-social-auth/social-core/pull/915 most likely addresses this issue, review wanted.