supabase icon indicating copy to clipboard operation
supabase copied to clipboard

MISSING JWT FIELD DOCUMENTATION

Open eyyyyyyy3 opened this issue 9 months ago • 1 comments

Improve documentation

Add a documentation page for the JWT fields.

Describe the problem

When trying to write a server the JWT need to be serialized. For that, the programmer needs to know the fields, their types and whether they are optional or not.

Additional context

I am authenticating the JWT in Rust and I need to know all the fields and their necessities. Additionally fields like ref are reserved keywords in Rust and they might pose a problem.

eyyyyyyy3 avatar May 23 '24 18:05 eyyyyyyy3

I agree this is an issue. There is more to validation than this, it seems. This may be related: https://github.com/supabase/supabase/issues/26716

swamidass avatar May 23 '24 19:05 swamidass

Turns out almost everything is optional. All you need is "role". Obviously, that wouldn't be best practices. You should at least include an iat and exp too. See the solution here: https://github.com/supabase/supabase/issues/26716

swamidass avatar May 25 '24 20:05 swamidass