fix: retrieve discovery document in validate_token function for improved token validation

This commit is contained in:
Mabe
2026-06-21 17:16:33 +02:00
parent c440f5aa1e
commit e7d9a44796
+1
View File
@@ -82,6 +82,7 @@ async def validate_token(credentials: HTTPAuthorizationCredentials = Security(se
token = credentials.credentials
key = get_signing_key(token)
public_key = jwk.construct(key)
discovery = get_discovery()
try:
# Only pass `audience` to the decoder if configured. Some providers
# (or local development setups) may not include the aud claim in a