def init_app(app): oauth.init_app(app) register_apps(oauth, [ 'github', ]) authorization_server.init_app(app, query_client=query_client) authorization_server.register_grant_endpoint(ClientCredentialsGrant) from zetanote.auth.controllers import auth app.register_blueprint(auth)
def test_register_built_in_app(self): app = Flask(__name__) app.config.update({ 'TWITTER_CLIENT_ID': 'twitter_key', 'TWITTER_CLIENT_SECRET': 'twitter_secret', }) oauth = OAuth(app) register_apps(oauth, ['twitter']) self.assertEqual(oauth.twitter.name, 'twitter') twitter = get_oauth_app(oauth, 'twitter') self.assertEqual(twitter, get_app('twitter')) self.assertEqual(twitter.name, 'twitter') self.assertEqual(twitter.client.name, 'twitter') self.assertTrue(callable(twitter.profile))
def init_app(app): oauth.init_app(app) register_apps(oauth, ['google', 'twitter', 'github', 'facebook'])
def init_app(app): oauth.init_app(app) register_apps(oauth, [])
def init_app(app): oauth.init_app(app) register_apps(oauth, ['google'])