Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@offbyone
Copy link
Contributor

@offbyone offbyone commented Jan 1, 2025

This is a follow-up to and addition onto #915

All that the preceding PR includes is part of it, plus tests passing. Props to @MohamedAhmed412000 for the initial work

It'll supersede #915 and #934

@codecov
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.91%. Comparing base (d216c96) to head (b243d44).
Report is 40 commits behind head on master.

Files with missing lines Patch % Lines
social_core/backends/linkedin.py 62.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #950      +/-   ##
==========================================
+ Coverage   77.77%   77.91%   +0.13%     
==========================================
  Files         347      347              
  Lines       10606    10673      +67     
  Branches      699      503     -196     
==========================================
+ Hits         8249     8316      +67     
+ Misses       2200     2198       -2     
- Partials      157      159       +2     
Flag Coverage Δ
unittests 77.91% <66.66%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nijel
Copy link
Member

nijel commented Jan 6, 2025

The failing tests are affected by gabrielfalcao/HTTPretty#484, but as they pass on 3.8 I assume this is safe to merge.

@nijel nijel merged commit 6221412 into python-social-auth:master Jan 6, 2025
4 of 9 checks passed
@offbyone offbyone deleted the fix-linkedin-backend branch January 6, 2025 15:30
@tuky
Copy link
Contributor

tuky commented Feb 26, 2025

@nijel I would like to suggest to release such changes as major version bumps. I understand that this change is needed for new apps to work. However, this change also killed OAuth with our old linkedin app. Is there any information available, how to transition old apps to this new flow? What settings have to be adjusted? This is our config that now breaks all caused by a patch version bump which IMO is utterly wrong. M$ so far has not forced us to do anything.

SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = ['r_liteprofile', 'r_emailaddress']
SOCIAL_AUTH_LINKEDIN_OAUTH2_FIELD_SELECTORS = ['emailAddress', 'profilePicture(displayImage~:playableStreams)']

SOCIAL_AUTH_LINKEDIN_OAUTH2_EXTRA_DATA = [
    ('id', 'id'),
    ('firstName', 'first_name'),
    ('lastName', 'last_name'),
    ('emailAddress', 'email_address'),
    ('profilePicture', 'profile_picture'),
]

@nijel
Copy link
Member

nijel commented Feb 26, 2025

Sorry, I didn't realize that this would be a breaking change, I considered it a fix for an API change. Unfortunately I have no knowledge of LinkedIn APIs....

ACCESS_TOKEN_METHOD = "POST"
REDIRECT_STATE = False
DEFAULT_SCOPE = ["r_liteprofile"]
DEFAULT_SCOPE = ["email", "profile", "openid"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These scopes are for OpenID Connect, not OAuth2. We shouldn't make such changes in LinkedinOAuth2 class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r_liteprofile was not working, see #922

@yuekui yuekui mentioned this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Linkedin OAuth dont work due new Linkedin scopes. LinkedIn Login not working, needs to be updated

5 participants