Changeset View
Changeset View
Standalone View
Standalone View
swh/auth/keycloak.py
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | class KeycloakOpenIDConnect: | ||||
def well_known(self) -> Dict[str, Any]: | def well_known(self) -> Dict[str, Any]: | ||||
""" | """ | ||||
Retrieve the OpenID Connect Well-Known URI registry from Keycloak. | Retrieve the OpenID Connect Well-Known URI registry from Keycloak. | ||||
Returns: | Returns: | ||||
A dictionary filled with OpenID Connect URIS. | A dictionary filled with OpenID Connect URIS. | ||||
""" | """ | ||||
try: | |||||
return self._keycloak.well_known() | |||||
except AttributeError: | |||||
# python-keycloak < 1.0.0 | |||||
ardumont: *yuck* | |||||
Done Inline Actions\_o< quack vlorentz: \_o< quack | |||||
return self._keycloak.well_know() | return self._keycloak.well_know() | ||||
def authorization_url(self, redirect_uri: str, **extra_params: str) -> str: | def authorization_url(self, redirect_uri: str, **extra_params: str) -> str: | ||||
""" | """ | ||||
Get OpenID Connect authorization URL to authenticate users. | Get OpenID Connect authorization URL to authenticate users. | ||||
Args: | Args: | ||||
redirect_uri: URI to redirect to once a user is authenticated | redirect_uri: URI to redirect to once a user is authenticated | ||||
extra_params: Extra query parameters to add to the | extra_params: Extra query parameters to add to the | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |
*yuck*