python Flask-oauth with facebook is throwing a webpage not found error -
i trying authenticate user using facebook oauth throwing webpage not found error after user allows app in facebook.
here's code:
from flask import redirect, flask, url_for, request app = flask(__name__) app.secret_key = 'asd' oauth = oauth() 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='xxx', consumer_secret='yyy', request_token_params={'scope': 'email'} ) @app.route('/login') def login(): print(url_for('oauth_authorized')) return facebook.authorize(callback='www.resoorce.com' + url_for('oauth_authorized')) @app.route('/oauth_authorized') @facebook.authorized_handler def oauth_authorized(resp): print("asd") if resp none: print(u'you denied request sign in.') return "noooo" print('you signed in %s' % resp['screen_name']) return "yeah!!!" if(__name__ == "__main__"): app.debug = true; app.run(hostname = '0.0.0.0', port=int(80))
no error thrown anywhere, webpage not found.
Comments
Post a Comment