diff --git a/powerdnsadmin/models/setting.py b/powerdnsadmin/models/setting.py index 51e78e5..a66b7d3 100644 --- a/powerdnsadmin/models/setting.py +++ b/powerdnsadmin/models/setting.py @@ -100,10 +100,7 @@ class Setting(db.Model): 'oidc_oauth_key': '', 'oidc_oauth_secret': '', 'oidc_oauth_scope': 'email', - 'oidc_oauth_api_url': '', - 'oidc_oauth_token_url': '', - 'oidc_oauth_authorize_url': '', - 'oidc_oauth_logout_url': '', + 'oidc_oauth_server_metadata_url': '', 'oidc_oauth_username': 'preferred_username', 'oidc_oauth_firstname': 'given_name', 'oidc_oauth_last_name': 'family_name', diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index 3a6f55c..417e05f 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -366,7 +366,7 @@ def login(): return authenticate_user(user, 'Azure OAuth') if 'oidc_token' in session: - me = json.loads(oidc.get('userinfo').text) + me = oidc.userinfo() oidc_username = me[Setting().get('oidc_oauth_username')] oidc_givenname = me[Setting().get('oidc_oauth_firstname')] oidc_familyname = me[Setting().get('oidc_oauth_last_name')] diff --git a/powerdnsadmin/services/oidc.py b/powerdnsadmin/services/oidc.py index 7e8172b..dfaaf54 100644 --- a/powerdnsadmin/services/oidc.py +++ b/powerdnsadmin/services/oidc.py @@ -19,10 +19,8 @@ def oidc_oauth(): 'oidc', client_id=Setting().get('oidc_oauth_key'), client_secret=Setting().get('oidc_oauth_secret'), - api_base_url=Setting().get('oidc_oauth_api_url'), request_token_url=None, - access_token_url=Setting().get('oidc_oauth_token_url'), - authorize_url=Setting().get('oidc_oauth_authorize_url'), + server_metadata_url=Setting().get('oidc_oauth_server_metadata_url'), client_kwargs={'scope': Setting().get('oidc_oauth_scope')}, fetch_token=fetch_oidc_token, update_token=update_token) diff --git a/powerdnsadmin/templates/admin_setting_authentication.html b/powerdnsadmin/templates/admin_setting_authentication.html index ba82c2e..ccd1743 100644 --- a/powerdnsadmin/templates/admin_setting_authentication.html +++ b/powerdnsadmin/templates/admin_setting_authentication.html @@ -610,23 +610,8 @@