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

coveralls commented Oct 30, 2025

Pull Request Test Coverage Report for Build 19035477504

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 19 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.03%) to 54.673%

Files with Coverage Reduction New Missed Lines %
internal/storage/rm/rm.go 2 80.61%
internal/gen/keys/keys.go 5 12.9%
internal/link/link.go 12 76.26%
Totals Coverage Status
Change from base Build 18933366405: -0.03%
Covered Lines: 6388
Relevant Lines: 11684

💛 - Coveralls

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, not sure. Do we have the ability to set an external for all components i.e a base url instead of 127.0.0.1for studio, api etc?

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