-
Notifications
You must be signed in to change notification settings - Fork 305
feat: add configurable JWT issuer for local auth development #4388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
This will be also configurable via |
|
Yes, similar to any other auth env variables, this will be also parsed by auth server 👍 |
Pull Request Test Coverage Report for Build 18940990217Details
💛 - Coveralls |
| fmt.Sprintf("GOTRUE_JWT_EXP=%v", utils.Config.Auth.JwtExpiry), | ||
| "GOTRUE_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, | ||
| "GOTRUE_JWT_ISSUER=" + utils.GetApiUrl("/auth/v1"), | ||
| "GOTRUE_JWT_ISSUER=" + jwtIssuer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "GOTRUE_JWT_ISSUER=" + jwtIssuer, | |
| "GOTRUE_JWT_ISSUER=" + utils.Config.Auth.JwtIssuer, |
Just a nitpick: I think we should apply the default value when loading config in case we need to use this value in other places in the future.
| "GOTRUE_MAILER_URLPATHS_INVITE=" + utils.GetApiUrl("/auth/v1/verify"), | ||
| "GOTRUE_MAILER_URLPATHS_CONFIRMATION=" + utils.GetApiUrl("/auth/v1/verify"), | ||
| "GOTRUE_MAILER_URLPATHS_RECOVERY=" + utils.GetApiUrl("/auth/v1/verify"), | ||
| "GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE=" + utils.GetApiUrl("/auth/v1/verify"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update these as well? Basically to use Config.Auth.JwtIssuer as the base url for every auth callback that user expects to load from their browser.
Summary
jwt_issuerfield to auth configuration in config.tomlMotivation
When developing OAuth integrations, the auth server OAuth discovery endpoint
/.well-known/oauth-authorization-serverreturns URLs referencinglocalhost, which are inaccessible to third-party services trying to integrate with the local instance.This change allows developers to configure the issuer url for the auth server, making it possible to test third-party OAuth integrations locally without deploying to a remote environment.
Relevant: https://github.com/orgs/supabase/discussions/38022#discussioncomment-14815820