diff --git a/powerdnsadmin/services/azure.py b/powerdnsadmin/services/azure.py index 901cc45..faf1ac3 100644 --- a/powerdnsadmin/services/azure.py +++ b/powerdnsadmin/services/azure.py @@ -24,9 +24,10 @@ def azure_oauth(): 'fetch_token': fetch_azure_token, } + auto_configure = Setting().get('azure_oauth_auto_configure') server_metadata_url = Setting().get('azure_oauth_metadata_url') - if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + if auto_configure and isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: authlib_params['server_metadata_url'] = server_metadata_url else: authlib_params['access_token_url'] = Setting().get('azure_oauth_token_url') diff --git a/powerdnsadmin/services/github.py b/powerdnsadmin/services/github.py index f322e8c..42862e9 100644 --- a/powerdnsadmin/services/github.py +++ b/powerdnsadmin/services/github.py @@ -26,9 +26,10 @@ def github_oauth(): 'update_token': update_token } + auto_configure = Setting().get('github_oauth_auto_configure') server_metadata_url = Setting().get('github_oauth_metadata_url') - if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + if auto_configure and isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: authlib_params['server_metadata_url'] = server_metadata_url else: authlib_params['access_token_url'] = Setting().get('github_oauth_token_url') diff --git a/powerdnsadmin/services/google.py b/powerdnsadmin/services/google.py index 011c120..e3e6362 100644 --- a/powerdnsadmin/services/google.py +++ b/powerdnsadmin/services/google.py @@ -25,9 +25,10 @@ def google_oauth(): 'update_token': update_token } + auto_configure = Setting().get('google_oauth_auto_configure') server_metadata_url = Setting().get('google_oauth_metadata_url') - if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + if auto_configure and isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: authlib_params['server_metadata_url'] = server_metadata_url else: authlib_params['access_token_url'] = Setting().get('google_token_url') diff --git a/powerdnsadmin/services/oidc.py b/powerdnsadmin/services/oidc.py index 25c73f0..2e36070 100644 --- a/powerdnsadmin/services/oidc.py +++ b/powerdnsadmin/services/oidc.py @@ -25,9 +25,10 @@ def oidc_oauth(): 'update_token': update_token } + auto_configure = Setting().get('oidc_oauth_auto_configure') server_metadata_url = Setting().get('oidc_oauth_metadata_url') - if isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: + if auto_configure and isinstance(server_metadata_url, str) and len(server_metadata_url.strip()) > 0: authlib_params['server_metadata_url'] = server_metadata_url else: authlib_params['access_token_url'] = Setting().get('oidc_oauth_token_url')