Skip to content

Commit 29168d1

Browse files
committed
Harden JWKS URL construction to avoid malformed endpoints
1 parent 4e1ebb8 commit 29168d1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

api/core/jwt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def _get_jwks_client() -> jwt.PyJWKClient:
1111

1212
if _jwks_client is None:
1313
_jwks_client = jwt.PyJWKClient(
14-
f"{settings.TDEI_OIDC_URL}realms/{settings.TDEI_OIDC_REALM}"
15-
f"/protocol/openid-connect/certs"
14+
f"{settings.TDEI_OIDC_URL.rstrip("/")}/realms/"
15+
f"{settings.TDEI_OIDC_REALM}/protocol/openid-connect/certs"
1616
)
1717

1818
return _jwks_client

0 commit comments

Comments
 (0)