Register Facebook with Google App Engine

I was looking a bit to use Facebook login to authenticate users on my website, and I had trouble finding good examples. I am using python in the Google App Engine and want to see if anyone has examples that are not on facebook or in facebook canvas. This option is very useful, but does not have a few points that I want to take.

I just want to use Facebook as a way to allow users to log in and check who they are on any page of my site. Any examples of this would be very helpful.

+4
source share
3 answers

If you want to experiment more, you can use Flask , which works great with the Google App Engine, and then on top of it, using Flask-OAuth, the authentication part is pretty straight forward ( full example ):

facebook = oauth.remote_app('facebook', base_url='https://graph.facebook.com/', request_token_url=None, access_token_url='/oauth/access_token', authorize_url='https://www.facebook.com/dialog/oauth', consumer_key=FACEBOOK_APP_ID, consumer_secret=FACEBOOK_APP_SECRET, request_token_params={'scope': 'email'} ) 

gae-init is one of my examples when I use Flask in the Google App Engine, and you can log in using Facebook or Twitter, except Log in to Google.

+5
source

This (unofficial) Facebook SDK for the Python fork has a bunch of examples, including one for the App Engine.

https://github.com/pythonforfacebook/facebook-sdk/tree/master/examples/appengine

(Note: not verified recently and not guaranteed by me or Facebook. But it can help.)

+1
source

This is not a short sample format, but here is a working code that supports registration and login through facebook:

https://github.com/mjibson/journalr/blob/master/main.py (search on facebook) https://github.com/mjibson/journalr/blob/master/facebook.py (just a simple module, which implements facebook API and is not a complete SDK)

0
source

Source: https://habr.com/ru/post/1436046/


All Articles