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

some linkedin oauth2 extra data doesn't show up #34

Closed
dblado opened this issue Sep 20, 2013 · 5 comments
Closed

some linkedin oauth2 extra data doesn't show up #34

dblado opened this issue Sep 20, 2013 · 5 comments

Comments

@dblado
Copy link
Contributor

dblado commented Sep 20, 2013

w/ the following configuration, first, last, and email are showing up in the mongoengine user documents but not in the user_social_auth documents

SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = ['r_fullprofile', 'r_emailaddress', 'rw_nus']
SOCIAL_AUTH_LINKEDIN_OAUTH2_FIELD_SELECTORS = ['summary', 'positions', 'email-address', 'headline', 'industry', 'educations']
SOCIAL_AUTH_LINKEDIN_OAUTH2_EXTRA_DATA = [('id', 'id'),
('first-name', 'first_name'),
('last-name', 'last_name'),
('summary', 'summary'),
('email-address', 'email-address'),
('headline', 'headline'),
('positions', 'positions'),
('industry', 'industry'),
('educations', 'educations')]

All of the data is captured, I just would have expected the email, first, and last name to be captured in both places (user and user_social_auth).

rs0:PRIMARY> db.user_social_auth.find({user: ObjectId('5222bf9ec64c8c9629cce5cd')}).pretty()
{
"_id" : ObjectId("5222bf9ec64c8c9629cce5ce"),
"extra_data" : {
"email-address" : null,
"last_name" : null,
"industry" : "Internet",
"first_name" : null,
"headline" : "PaaS Evangelist",
"id" : "ZURjBbzFZH"
},
"provider" : "linkedin-oauth2",
"uid" : "ZURjBbzFZH",
"user" : ObjectId("5222bf9ec64c8c9629cce5cd")
}

The corresponding User:

{
"cls" : "User",
"id" : ObjectId("5222bf9ec64c8c9629cce5cd"),
"date_joined" : ISODate("2013-09-01T04:16:30.637Z"),
"email" : "dblad
**oo.com",
"first_name" : "D__id",
"is_active" : true,
"is_staff" : false,
"is_superuser" : false,
"last_login" : ISODate("2013-09-20T16:09:29.834Z"),
"last_name" : "Bl__o",
"password" : *__,
"username" : "Da
***ado"
}

@omab
Copy link
Owner

omab commented Sep 20, 2013

@dblado, try with this setting:

SOCIAL_AUTH_LINKEDIN_OAUTH2_EXTRA_DATA = [
    ('id', 'id'),
    ('first-name', 'firstName'),
    ('last-name', 'lastName'),
    ('summary', 'summary'),
    ('email-address', 'emailAddress'),
    ('headline', 'headline'),
    ('positions', 'positions'),
    ('industry', 'industry'),
    ('educations', 'educations')
]

@dblado
Copy link
Contributor Author

dblado commented Sep 20, 2013

same:

    "emailAddress" : null,
    "lastName" : null,

@omab
Copy link
Owner

omab commented Sep 20, 2013

@dblado, sorry, typed too quickly, this is the correct value for that setting:

SOCIAL_AUTH_LINKEDIN_OAUTH2_EXTRA_DATA = [
    ('id', 'id'),
    ('firstName', 'first_name'),
    ('lastName', 'last_name'),
    ('summary', 'summary'),
    ('emailAddress', 'email_address'),
    ('headline', 'headline'),
    ('positions', 'positions'),
    ('industry', 'industry'),
    ('educations', 'educations')
]

The settings will be under s.extra_data['first_name'], s.extra_data['last_name'], s.extra_data['email_address']

@dblado
Copy link
Contributor Author

dblado commented Sep 20, 2013

yep that did it...thanks!

@omab
Copy link
Owner

omab commented Sep 20, 2013

Cool, I'm closing the issue.

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

No branches or pull requests

2 participants