Question

social-auth facebook authentication.

i can get user photo:

 <p>You are logged in as {{ user.username }} !</p>
<img src="http://graph.facebook.com/{{ user.username }}/picture?type=square" > <--working 

code link : https://github.com/omgbbqhaxx/python-social-auth/blob/master/examples/django_example/example/templates/done.html

i need userid , fullname , lastname how can i get ? you can send me pull request.

Was it helpful?

Solution

Define this setting:

SOCIAL_AUTH_FACEBOOK_EXTRA_DATA = ['first_name', 'last_name']

Then you can access those values with:

social = user.social_auth.get(provider='facebook')
userid = social.uid
first_name = social.extra_data['first_name']
last_name = social.extra_data['last_name']
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top