use urlsafe_base64decode for keycloak id tokens to support certain utf8 characters w/ burnettk (#852)

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
jasquat 2024-01-03 16:14:14 -05:00 committed by GitHub
parent 0b296f4c46
commit 6bafd7b144
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -456,7 +456,9 @@ def _parse_id_token(token: str) -> Any:
payload = parts[1]
padded = payload + "=" * (4 - len(payload) % 4)
decoded = base64.b64decode(padded)
# https://lists.jboss.org/pipermail/keycloak-user/2016-April/005758.html
decoded = base64.urlsafe_b64decode(padded)
return json.loads(decoded)