From b0641272491eb51d321b1b8a7d062e395e70800f Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 19 Dec 2022 16:02:19 +0300 Subject: auth: implement OAuth2 flow. Add code to implement the OAuth2 flow. * Add test fixtures for setting up users and OAuth2 clients * Add tests for token generation with the "Password Grant" flow * Fix some issues with test due to changes in the database connection's row_factory --- gn3/app.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gn3/app.py') diff --git a/gn3/app.py b/gn3/app.py index a187e54..b776351 100644 --- a/gn3/app.py +++ b/gn3/app.py @@ -19,6 +19,8 @@ from gn3.api.async_commands import async_commands from gn3.api.menu import menu from gn3.api.search import search from gn3.api.metadata import metadata +from gn3.auth.authentication.oauth2.views import oauth2 +from gn3.auth.authentication.oauth2.server import setup_oauth2_server def create_app(config: Union[Dict, str, None] = None) -> Flask: @@ -56,4 +58,7 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask: app.register_blueprint(menu, url_prefix="/api/menu") app.register_blueprint(search, url_prefix="/api/search") app.register_blueprint(metadata, url_prefix="/api/metadata") + app.register_blueprint(oauth2, url_prefix="/api/oauth2") + + setup_oauth2_server(app) return app -- cgit v1.2.3