fix: accept ES256 (ECC P-256) JWT keys alongside RS256 in backend auth
Supabase JWT key was switched to ECC P-256, but the JWKS verification only accepted RS256. Add ES256 to the accepted algorithms list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -60,7 +60,7 @@ def _verify_jwt_hs256(token: str) -> dict | None:
|
||||
|
||||
|
||||
def _verify_jwt(token: str) -> dict | None:
|
||||
"""Verify JWT using JWKS (RS256), falling back to HS256 shared secret."""
|
||||
"""Verify JWT using JWKS (RS256/ES256), falling back to HS256 shared secret."""
|
||||
client = _get_jwks_client()
|
||||
if client:
|
||||
try:
|
||||
@@ -68,7 +68,7 @@ def _verify_jwt(token: str) -> dict | None:
|
||||
return jwt.decode(
|
||||
token,
|
||||
signing_key.key,
|
||||
algorithms=["RS256"],
|
||||
algorithms=["RS256", "ES256"],
|
||||
audience="authenticated",
|
||||
)
|
||||
except jwt.InvalidTokenError:
|
||||
|
||||
Reference in New Issue
Block a user