Skip to content

Conversation

@cemalkilic
Copy link
Contributor

Summary

  • Adds configurable jwt_issuer field to auth configuration in config.toml
  • Updates startup to use configured JWT issuer when set
  • Maintains backward compatibility by falling back to default API URL when not configured

Motivation

When developing OAuth integrations, the auth server OAuth discovery endpoint /.well-known/oauth-authorization-server returns URLs referencing localhost, 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

@cemalkilic cemalkilic requested a review from a team as a code owner October 30, 2025 12:42
@aantti
Copy link

aantti commented Oct 30, 2025

This will be also configurable via GOTRUE_JWT_ISSUER env-var for self-hosted Supabase?

@cemalkilic
Copy link
Contributor Author

Yes, similar to any other auth env variables, this will be also parsed by auth server 👍

@coveralls
Copy link

Pull Request Test Coverage Report for Build 18940990217

Details

  • 3 of 5 (60.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 54.676%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/start/start.go 3 5 60.0%
Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 18933366405: -0.03%
Covered Lines: 6390
Relevant Lines: 11687

💛 - 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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.

Comment on lines 502 to 505
"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"),
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants