Facebook Registration on Google App Engine

2019-04-09 10:07发布

I have looked a bit into using the Facebook Registration for user authentication on my website and I am having trouble finding good examples. I am using python on Google App Engine and wanted to see if anyone had examples that are not on facebook or in facebook canvas. This one is very helpful but doesn't have a few points I want to took at.

I just simply want to use Facebook as a way to allow users to log in and to be able to verify who they are on any page of my website. Any examples of this would be greatly appreciated.

3条回答
三岁会撩人
2楼-- · 2019-04-09 10:21

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

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

(Note: not tested recently, nor warranted by me or Facebook. But could help.)

查看更多
Root(大扎)
3楼-- · 2019-04-09 10:33

If you would like to experiment more you could use Flask which integrates nicely with Google App Engine and then on top of it by using the Flask-OAuth the authentication part it's 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 where I'm using Flask on Google App Engine and you could login using Facebook or Twitter besides the Google login.

查看更多
叼着烟拽天下
4楼-- · 2019-04-09 10:35

It's not in terse example format, but here is working code that supports registration and login through facebook:

https://github.com/mjibson/journalr/blob/master/main.py (search for "facebook") https://github.com/mjibson/journalr/blob/master/facebook.py (just a simple module that implements the facebook API and isn't the full SDK)

查看更多
登录 后发表回答