HELP: admin.generateLink / admin.getUserById fail with "unrecognized JWT kid" after JWT Signing Keys migration — blocks Auth Admin API entirely #48323
|
Hi everyone! After migrating to the new JWT Signing Keys (ES256), I've run into an issue where admin.generateLink() and admin.getUserById() consistently fail with:
Thanks so much for any help! |
Replies: 1 comment 2 replies
|
The important distinction here is that Supabase documents both the new signing-key model and the two API-key types here:
As a temporary backend-only workaround, if the legacy key is still available, create the admin client with the legacy service-role JWT rather than the const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!,
{ auth: { autoRefreshToken: false, persistSession: false } }
)Keep that key only in Edge Function secrets; do not put it in browser code, return it to clients, or log it. This should let you verify whether the failure is specifically the new-key/Auth Admin compatibility path while the support ticket is investigated. If the legacy secret has been removed, I would not mint a custom JWT as a workaround; the safer next step is to ask Supabase to confirm support for |
The important distinction here is that
sb_secret_...is an opaque API secret, not a JWT. The legacyservice_rolekey is a JWT. That matches the symptom: the Auth Admin path is trying to verify a JWT and reportskid <nil>, while an opaque key does not carry JWT header fields such askid.Supabase documents both the new signing-key model and the two API-key types here:
As a temporary backend-only workaround, if the legacy key is still available, create the admin client with the legacy service-role JWT rather than the
sb_secret_...key: