add a bit more debugging info

This commit is contained in:
burnettk 2023-01-04 23:09:13 -05:00
parent 98279965c8
commit 455a04113c
1 changed files with 3 additions and 3 deletions

View File

@ -52,12 +52,12 @@ class AuthenticationService:
@classmethod @classmethod
def open_id_endpoint_for_name(cls, name: str) -> str: def open_id_endpoint_for_name(cls, name: str) -> str:
"""All openid systems provide a mapping of static names to the full path of that endpoint.""" """All openid systems provide a mapping of static names to the full path of that endpoint."""
openid_config_url = f"{cls.server_url()}/.well-known/openid-configuration"
if name not in AuthenticationService.ENDPOINT_CACHE: if name not in AuthenticationService.ENDPOINT_CACHE:
request_url = f"{cls.server_url()}/.well-known/openid-configuration" response = requests.get(openid_config_url)
response = requests.get(request_url)
AuthenticationService.ENDPOINT_CACHE = response.json() AuthenticationService.ENDPOINT_CACHE = response.json()
if name not in AuthenticationService.ENDPOINT_CACHE: if name not in AuthenticationService.ENDPOINT_CACHE:
raise Exception(f"Unknown OpenID Endpoint: {name}") raise Exception(f"Unknown OpenID Endpoint: {name}. Tried to get from {openid_config_url}")
return AuthenticationService.ENDPOINT_CACHE.get(name, "") return AuthenticationService.ENDPOINT_CACHE.get(name, "")
@staticmethod @staticmethod