def create_oauth_app(service_config, name): upper_name = name.upper() app.config[upper_name] = service_config service_oauth = oauth.OAuth() service_app = service_oauth.remote_app(name, app_key=upper_name) service_oauth.init_app(app) return service_app
return user_db return create_user_db( auth_id, util.create_name_from_email(google_user.email()), google_user.email(), google_user.email(), verified=True, admin=users.is_current_user_admin(), ) ############################################################################### # Twitter ############################################################################### twitter_oauth = oauth.OAuth() app.config['TWITTER'] = dict( base_url='https://api.twitter.com/1.1/', request_token_url='https://api.twitter.com/oauth/request_token', access_token_url='https://api.twitter.com/oauth/access_token', authorize_url='https://api.twitter.com/oauth/authorize', consumer_key=config.CONFIG_DB.twitter_consumer_key, consumer_secret=config.CONFIG_DB.twitter_consumer_secret, ) twitter = twitter_oauth.remote_app('twitter', app_key='TWITTER') twitter_oauth.init_app(app) @app.route('/_s/callback/twitter/oauth-authorized/')