Replies: 1 comment
|
This looks more like a verification-state/configuration divergence after the signing-key rotation than a malformed client token, especially because GoTrue itself is issuing the ES256 token and then I would isolate this in three steps before concluding that the project is in a bad internal state. 1. Verify the freshly issued token independently against the project JWKSSince the token header contains: and the same verify that exact JWT locally using the matching JWK. If local verification succeeds, that establishes: That would make a client-side token-generation problem much less likely. I would also check the usual claims while doing this: particularly that 2. Determine whether
|
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
After rotating JWT signing from Legacy HS256 to ECC P-256, the /auth/v1/user endpoint returns HTTP 401 for every access token — including tokens freshly issued seconds earlier by GoTrue itself.
Project ref: foantlwwnlvobhzdnhnq
Auth version: 2.195.0
supabase-js: 2.108.2
What happens:
User logs in → GoTrue issues an ES256 token (verified via JWT header decode: alg=ES256, kid=1eebd6c2)
Token has valid sub, role=authenticated, 1 hour until expiry
Immediately calling GET /auth/v1/user with that token → HTTP 401
PostgREST receives all authenticated requests as role=anon, sub=null, auth_uid=null
JWKS endpoint (/auth/v1/.well-known/jwks.json) correctly shows both current and previous ECC keys
What was tried (no effect):
Project restart (before key rotation)
Created new standby ECC key → promoted to current (1eebd6c2)
Project restart (after key rotation)
Tested on web and native apps, multiple browsers, fresh sessions
Auth log entry for the 401:
{
"error": "401: This endpoint requires a valid Bearer token",
"error_code": "no_authorization",
"path": "/user",
"status": 401
}
Raw fetch test (both fail identically):
GET /auth/v1/user
apikey: <anon_key>
Authorization: Bearer <ES256 token, kid=1eebd6c2, exp +1h>
→ HTTP 401
JWKS response (correct, shows both keys):
{"keys":[
{"alg":"ES256","kid":"2ec96aac-...","kty":"EC"},
{"alg":"ES256","kid":"1eebd6c2-...","kty":"EC"}
]}
GoTrue issues tokens with kid=1eebd6c2 but cannot verify them. The issue appears to be in GoTrue's internal key verification state for this specific project.
All reactions