Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fetching facebook data once logged in using django-social-auth

We've set up an application that uses the django-social-auth extension to authenticate users with Facebook. The authentication works fine, but we are not clear on how to go about fetching useful information from Facebook (friends lists, likes, etc.) It appears that django-facebook handles some of this functionality, but also handles the authorization aspects. Is there an application that would sit neatly on top of django-social-auth and provide a framework for using facebook data? Using django-social-auth and django-facebook together seems kludgy.

like image 355
nat Avatar asked Jan 14 '12 18:01

nat


People also ask

How does Django integrate with Facebook login?

Run Your Django Project. Visit login page in the browser using localhost URL. It will look like this in the browser. Click on Log with Facebook and follow the steps. After log in, you will be redirected to the home page.

How use Django social authentication?

Django Setup Set up the initial tables and add a superuser: $ python manage.py migrate Operations to perform: Apply all migrations: admin, contenttypes, auth, sessions Running migrations: Applying contenttypes. 0001_initial... OK Applying auth. 0001_initial... OK Applying admin.


2 Answers

You might want to look into facepy. You could use the Facebook oAuth access token that django-social-auth saves in your database and make whichever Graph API calls your application is permitted to make for the given user.

like image 127
dshap Avatar answered Sep 23 '22 06:09

dshap


It shouldn't be too hard to roll it yourself. The Facebook graph API is just HTTP get requests with the access_token, and it returns JSON data.

like image 41
Amandasaurus Avatar answered Sep 25 '22 06:09

Amandasaurus