Skip to content
Snippets Groups Projects
Verified Commit e1bc4f10 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

swh.auth.keycloak: Expose KeycloakError exception

This will allow caller code to depend on it without leaking the exception from the
keycloak module.
parent 57583d2b
No related branches found
Tags v0.3.5
1 merge request!5swh.auth.keycloak: Expose KeycloakError exception
......@@ -8,6 +8,10 @@ from urllib.parse import urlencode
from keycloak import KeycloakOpenID
# The next import is required to allow callers to catch on their own term the following
# exception
from keycloak.exceptions import KeycloakError # noqa
from swh.core.config import load_from_envvar
......@@ -71,6 +75,9 @@ class KeycloakOpenIDConnect:
Get OpenID Connect authentication tokens using Authorization
Code flow.
Raises:
KeycloakError in case of authentication failures
Args:
code: Authorization code provided by Keycloak
redirect_uri: URI to redirect to once a user is authenticated
......@@ -91,6 +98,9 @@ class KeycloakOpenIDConnect:
"""
Get OpenID Connect authentication tokens using Direct Access Grant flow.
Raises:
KeycloakError in case of authentication failures
Args:
username: an existing username in the realm
password: password associated to username
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment