r/Supabase • u/Daksh2338 • Dec 10 '25
auth Need help with JWT verification
I have a React Native app that uses Supabase for authentication. I’m now trying to send the Supabase access token (JWT) to my Python FastAPI backend so I can protect certain endpoints using this token.
However, the token verification keeps failing due to a “secret key mismatch” error.
I’m currently using the legacy secret key from Project Settings → JWT Keys → Secret Key (Legacy).
Could you help me understand why the verification is failing and what the correct approach is for validating Supabase JWTs on a FastAPI backend?
- update : “solved” thank you all who commented your thoughts helped
2
Upvotes
1
u/rzagmarz Dec 10 '25
Are you correctly using the uris for validation? I think they may work only with the new keys.
You can test, switching should be straightforward
I remember faced that error once but solved somehow. Well, Cursor solved it 🤷🏽
1
u/SheriffSeveral Dec 10 '25
Did you encode/decode jwt to base64 before the assignment? If you don't, always encode important keys with b64 and when you need it decode de b64 and use it.
Mismatch might be happening because of some characters, please also check that.
0
u/Daksh2338 Dec 10 '25
Cursor js looping right now