supabase icon indicating copy to clipboard operation
supabase copied to clipboard

The docker self hosting SERVICE_ROLE_KEY and ANON_KEY generators seem to be broken:

Open ManuelAngel99 opened this issue 4 months ago • 2 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The documentation for self hosting includes a tool for generating your service_role_key and anon_key variables from a given JWT. That tool is broken and generates keys that are not correct. When trying to use those keys in a local docker deployment, a postgres JWT validation error raises.

Link to the tool I am talking about: https://supabase.com/docs/guides/self-hosting/docker#generate-api-keys

Please fix that tool and/or provide instructions on how to generate the anon and service role keys from the cli in those docs.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to https://supabase.com/docs/guides/self-hosting/docker#generate-api-keys
  2. Introduce the default JWT generated by the supabase cli when using supabase init && supabase start. The expected keys that should be generated are:
JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
anon key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
service_role key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3Mi***
  1. However, on the website, the generated anon_key and service_role_keys are:
anon_key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzEzMTMyMDAwLAogICJleHAiOiAxODcwODk4NDAwCn0.8ikRV9PwHlkzCwy3IZmTMFbduO2Oy1tPj5YmeUGgtbo

service_role_key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogInNlcnZ**

Expected behavior

The generated keys should work when using them in the local deployment.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: Ubuntu 22.10
  • Browser (if applies) Brave Browser

ManuelAngel99 avatar Apr 15 '24 17:04 ManuelAngel99

Same here!

ToniRV avatar Apr 15 '24 18:04 ToniRV

transferring to the supabase main repo since this is a platform issue and not in the scope of the auth service

kangmingtay avatar May 02 '24 11:05 kangmingtay