fix: explicitly pass RS256 algorithm to jose.jwk.construct to handle JWKS keys without alg field
Some checks failed
CI / lint-and-test (push) Has been cancelled
Some checks failed
CI / lint-and-test (push) Has been cancelled
This commit is contained in:
@@ -52,7 +52,7 @@ def _decode_token(token: str, jwks):
|
|||||||
if not key_dict:
|
if not key_dict:
|
||||||
raise HTTPException(status_code=401, detail="Invalid token: signing key not found")
|
raise HTTPException(status_code=401, detail="Invalid token: signing key not found")
|
||||||
|
|
||||||
key = construct(key_dict)
|
key = construct(key_dict, algorithm="RS256")
|
||||||
decode_kwargs = {"algorithms": ["RS256"]}
|
decode_kwargs = {"algorithms": ["RS256"]}
|
||||||
if AUTH_CLIENT_ID:
|
if AUTH_CLIENT_ID:
|
||||||
decode_kwargs["audience"] = AUTH_CLIENT_ID
|
decode_kwargs["audience"] = AUTH_CLIENT_ID
|
||||||
|
|||||||
Reference in New Issue
Block a user