Wrong role claim on PostgREST #614
-
Hi there, First of all, congrats on the amazing work you guys have done on Supabase, it’s pretty straightforward! Having an issue with PostgREST auth (managed Supabase), I’m using the default service_role token to insert data (I wanna lock anon to read only), however, somehow it’s being detected as anon. At least that’s the conclusion I came to after this behavior:
I can confirm that I’m using the correct token. Not using one would result an authorization failure (from the PostgREST docs, it should default to the anon role; unless that’s an exception in production). Can’t really seem track this issue down on my own. Note: haven’t tried generating a new JWT with service_role as the role claim, only tried the default one from the dashboard, but since it’s a JWT this shouldn’t be relevant. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Hey @andreivreja, Can you double check you're using the service_role JWT? You can paste it in jwt.io and see if the Also note that you shouldn't be using |
Beta Was this translation helpful? Give feedback.
Hey @andreivreja,
Can you double check you're using the service_role JWT? You can paste it in jwt.io and see if the
role
claim hasservice_role
.Also note that you shouldn't be using
service_role
for clients.