omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

make custom user to retrieve extra data #944

Closed vvirads closed 7 years ago

vvirads commented 8 years ago

Hello, I'm Beginner . please what is the best method to create a custom user and retrieve extra data from Linkedin Auth. Import succeded in social_auth_usersocial_auth. But you didn't mention simply and clearly how to retrieve these information. examples please

Christopher2K commented 8 years ago

Hi ! I'm in the same situation. I'm looking for a way to retrieve informations, save it into my db & link local account and FB account !

omab commented 7 years ago

Assuming LinkedIn OAuth2 and Django, the access token is stored in the UserSocialAuth instance corresponding to linkedin-oauth2, to get it you can do:

access_token = user.social_auth.filter(provider='linkedin-oauth2')[0].access_token

With that token you can call any of the LinkedIn APIs that the scope allows you to do.