© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
48 replies
thoschill

Role based authorization with GoTrue

Hello everyone,

I'm currently implementing a supabase spring boot starter and wanted to implement custom roles with GoTrue.
My Idea was to store the roles as a JSON Object in the user_metadata or is it better to use the app_metadata column?

In the GoTrue-KT Library I'm using there is only the /user endpoint implemented:
https://github.com/supabase/gotrue#put-user
Am I correct that any user could just talk to the GoTrue Endpoint directly with his JWT and give himself a Role?

Should I then instead use the /admin/users/<user_id> endpoint? It says that the JWT needs the admin role? Where do I set this?
https://github.com/supabase/gotrue#post-put-adminusersuser_id

Or is there a better way to implement this?

Thanks for your help!
GitHub
GitHub - supabase/gotrue: A JWT based API for managing users and is...
A JWT based API for managing users and issuing JWT tokens - GitHub - supabase/gotrue: A JWT based API for managing users and issuing JWT tokens
GitHub - supabase/gotrue: A JWT based API for managing users and is...
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Discord-like role authorization
SupabaseSSupabase / help-and-questions
14mo ago
Role based authentication
SupabaseSSupabase / help-and-questions
4y ago
Getting started with GoTrue on Docker
SupabaseSSupabase / help-and-questions
4y ago
Manually update GoTrue?
SupabaseSSupabase / help-and-questions
3y ago