fix: retrieve discovery document in validate_token function for improved token validation
This commit is contained in:
@@ -82,6 +82,7 @@ async def validate_token(credentials: HTTPAuthorizationCredentials = Security(se
|
|||||||
token = credentials.credentials
|
token = credentials.credentials
|
||||||
key = get_signing_key(token)
|
key = get_signing_key(token)
|
||||||
public_key = jwk.construct(key)
|
public_key = jwk.construct(key)
|
||||||
|
discovery = get_discovery()
|
||||||
try:
|
try:
|
||||||
# Only pass `audience` to the decoder if configured. Some providers
|
# Only pass `audience` to the decoder if configured. Some providers
|
||||||
# (or local development setups) may not include the aud claim in a
|
# (or local development setups) may not include the aud claim in a
|
||||||
|
|||||||
Reference in New Issue
Block a user