Skip to content

Commit fdfca15

Browse files
committed
changed exception to keycloak auth exception
1 parent ad40417 commit fdfca15

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/src/kutils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66

77
from keycloak import KeycloakAdmin, KeycloakOpenID
8+
from keycloak.exceptions import KeycloakAuthenticationError
89

910

1011
def initialize_keycloak_admin() -> KeycloakAdmin:
@@ -39,5 +40,5 @@ def get_token(username: str, password: str) -> dict:
3940
try:
4041
token = kopenid.token(username, password)
4142
return token
42-
except Exception:
43+
except KeycloakAuthenticationError:
4344
return None

0 commit comments

Comments
 (0)