Skip to content

Commit

Permalink
Added a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jcadam14 committed Dec 4, 2024
1 parent e506342 commit 4ad53ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/regtech_api_commons/oauth2/oauth2_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def __init__(self, kc_settings: KeycloakSettings) -> None:

def get_claims(self, token: str) -> Dict[str, str] | None:
try:
# Get the key id from the token header, and use that to find
# the correct public key from Keycloak. Then use the public key
# to decode the token and get the claims
kid = jwt.get_unverified_header(token).get("kid")
keys = self._get_keys()
key = next((key for key in keys["keys"] if key["kid"] == kid), None)
Expand Down

0 comments on commit 4ad53ab

Please sign in to comment.