Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkedIn API not returning fullprofile data #397

Closed
samgclarke opened this issue Oct 1, 2013 · 6 comments
Closed

LinkedIn API not returning fullprofile data #397

samgclarke opened this issue Oct 1, 2013 · 6 comments

Comments

@samgclarke
Copy link

Using the LinkedIn API, and adding 'r_fullprofile' to the SCOPE in settings.py, I get the authorization page asking for access to the full profile. However, when I inspect the extra_data dict there is no full profile data.

authorize_linkedin

@pennersr
Copy link
Owner

pennersr commented Oct 9, 2013

Please check out the note over at:

https://github.com/pennersr/django-allauth#linkedin

Is your LinkedIn app an old or new one?

@samgclarke
Copy link
Author

This is a new LinkedIn app, created about a week ago.

@samgclarke
Copy link
Author

It seems that in allauth/socialaccount/providers/linkedin/provider.py, the fields list is not being modified by the SCOPE dict in project.settings. For example, if I manually add the 'skills' field to this list, then that data is successfully returned in extra_data.

@pennersr
Copy link
Owner

I am sorry, but I am a little time constraint and have not been able to dive into your issue, yet. Do note that there is a get_scope method in the OAuthProvider base class from which the LinkedIn provider inherits...

@samgclarke
Copy link
Author

Yes, in socialaccount/providers/linkedin/views.py, I can do this:

class LinkedInAPI(OAuth):
    url = 'https://api.linkedin.com/v1/people/~'
    fields = ['id',
          'first-name',
          'last-name',
          'email-address',
          'picture-url',
          'public-profile-url']
    # instantiate provider and get scope
    provider = LinkedInProvider()
    if 'r_fullprofile' in provider.get_scope():
        fields.extend(['skills', 'summary', 'headline'])

to get what I want. Do you have any suggestions as to how I can extend your package in my project to provide this functionality, while still installing the base package via pip?

Thanks,

Sam

@pennersr
Copy link
Owner

I have moved the fields into the settings -- see the LinkedIn section in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants