3

I am using python-social-auth to retrieve LinkedIn profile data in Django.

<a href="{% url 'social:begin' 'linkedin-oauth2' %}?next={{ request.path }}">Login with LinkedIn</a>

is the link to login with LinkedIn.

SOCIAL_AUTH_LINKEDIN_OAUTH2_EXTRA_DATA = [('id', 'id'), ('firstName', 'first_name'), ('lastName', 'last_name'), ('email-address', 'email_address'), ('positions', 'positions'), ('summary', 'summary'), ('headline', 'headline'), ('picture-url', 'picture_url'),
                       ('site-standard-profile-request', 'site_standard_profile_request'), ('public-profile-url', 'public_profile_url'), ('location', 'location'), ('interests', 'interests'), ('skills', 'skills'), ('languages', 'languages'),]

However, when I check the extra data, it returns only the first name, last name, access token and id correctly. Everything else is null.

What am I missing?

Deepti
  • 576
  • 2
  • 5
  • 15

1 Answers1

0

The settings to obtain the extra data must be in the following format:

SOCIAL_AUTH_LINKEDIN_FIELD_SELECTORS = [
    'public-profile-url',
    'email-address',
    'interests',
    'skills',
]
SOCIAL_AUTH_LINKEDIN_SCOPE = ['r_basicprofile', 'r_emailaddress']
cansadadeserfeliz
  • 3,033
  • 5
  • 34
  • 50