From 4fb3b02a4600c7ed4419319e288192b9ab992a95 Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 28 Jul 2022 17:59:18 +0200 Subject: [PATCH] [sso-admin] Remove left over OIDC code This was left over by a previous contributor and is not being used and was never really used; it looks like we can safely remove these. --- dd-sso/admin/src/admin/auth/authentication.py | 18 ------------- dd-sso/admin/src/admin/views/WebViews.py | 27 ------------------- dd-sso/admin/src/client_secrets.json | 13 --------- 3 files changed, 58 deletions(-) delete mode 100644 dd-sso/admin/src/client_secrets.json diff --git a/dd-sso/admin/src/admin/auth/authentication.py b/dd-sso/admin/src/admin/auth/authentication.py index f7da0be..5d9ea9b 100644 --- a/dd-sso/admin/src/admin/auth/authentication.py +++ b/dd-sso/admin/src/admin/auth/authentication.py @@ -23,24 +23,6 @@ from flask_login import LoginManager, UserMixin from admin import app -""" OIDC TESTS """ -# from flask_oidc import OpenIDConnect -# app.config.update({ -# 'SECRET_KEY': 'u\x91\xcf\xfa\x0c\xb9\x95\xe3t\xba2K\x7f\xfd\xca\xa3\x9f\x90\x88\xb8\xee\xa4\xd6\xe4', -# 'TESTING': True, -# 'DEBUG': True, -# 'OIDC_CLIENT_SECRETS': 'client_secrets.json', -# 'OIDC_ID_TOKEN_COOKIE_SECURE': False, -# 'OIDC_REQUIRE_VERIFIED_EMAIL': False, -# 'OIDC_VALID_ISSUERS': ['https://sso.mydomain.duckdns.org:8080/auth/realms/master'], -# 'OIDC_OPENID_REALM': 'https://sso.mydomain.duckdns.org//custom_callback', -# 'OVERWRITE_REDIRECT_URI': 'https://sso.mydomain.duckdns.org//custom_callback', -# }) -# # 'OVERWRITE_REDIRECT_URI': 'https://sso.mydomain.duckdns.org//custom_callback', -# # 'OIDC_CALLBACK_ROUTE': '//custom_callback' -# oidc = OpenIDConnect(app) -""" OIDC TESTS """ - login_manager = LoginManager() login_manager.init_app(app) diff --git a/dd-sso/admin/src/admin/views/WebViews.py b/dd-sso/admin/src/admin/views/WebViews.py index c8a62e7..d72db1e 100644 --- a/dd-sso/admin/src/admin/views/WebViews.py +++ b/dd-sso/admin/src/admin/views/WebViews.py @@ -49,33 +49,6 @@ avatars = Avatars() from ..lib.legal import gen_legal_if_not_exists -""" OIDC TESTS """ -# from ..auth.authentication import oidc - -# @app.route('/custom_callback') -# @oidc.custom_callback -# def callback(data): -# return 'Hello. You submitted %s' % data - -# @app.route('/private') -# @oidc.require_login -# def hello_me(): -# info = oidc.user_getinfo(['email', 'openid_id']) -# return ('Hello, %s (%s)! Return' % -# (info.get('email'), info.get('openid_id'))) - - -# @app.route('/api') -# @oidc.accept_token(True, ['openid']) -# def hello_api(): -# return json.dumps({'hello': 'Welcome %s' % g.oidc_token_info['sub']}) - - -# @app.route('/logout') -# def logoutoidc(): -# oidc.logout() -# return 'Hi, you have been logged out! Return' -""" OIDC TESTS """ def render_template(*args, **kwargs): kwargs["DOMAIN"] = os.environ["DOMAIN"] diff --git a/dd-sso/admin/src/client_secrets.json b/dd-sso/admin/src/client_secrets.json deleted file mode 100644 index 091d005..0000000 --- a/dd-sso/admin/src/client_secrets.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "web": { - "auth_uri": "https://sso.[[DOMAIN]]/auth/realms/master/protocol/openid-connect/auth", - "client_id": "adminapp", - "client_secret": "8a9e5a2e-3be9-43e3-9c47-1796f0d5ab72", - "redirect_uris": [ - "https://sso.[[DOMAIN]]/oidc_callback" - ], - "userinfo_uri": "https://sso.[[DOMAIN]]/auth/realms/master/protocol/openid-connect/userinfo", - "token_uri": "https://sso.[[DOMAIN]]/auth/realms/master/protocol/openid-connect/token", - "token_introspection_uri": "https://sso.[[DOMAIN]]/auth/realms/master/protocol/openid-connect/token/introspect" - } -} \ No newline at end of file