Repository navigation
Conversation
its-ammu
force-pushed
the
feat/azure-client-assertion-file
branch
from
December 4, 2026 12:29
61139e4 to
d3a6e5a
Compare
its-ammu
force-pushed
the
feat/azure-client-assertion-file
branch
from
December 4, 2026 12:33
d3a6e5a to
ed4d75a
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature request: https://github.com/orgs/supabase/discussions/54617
What
The Azure provider can now authenticate the code exchange with a client assertion read from a file, instead of a client secret.
When it is set:
client_assertionandclient_assertion_type(urn:ietf:params:oauth:client-assertion-type:jwt-bearer) in the form body, with no Basic auth header.GOTRUE_EXTERNAL_AZURE_SECRETis not required. If one is still set, it is never sent.When it is not set, nothing changes.
Why
This enables Entra workload identity federation. The Entra app trusts tokens from an external OIDC issuer, such as a Kubernetes cluster's service account issuer, so no client secret has to be stored or rotated. On AKS, EKS or GKE, the platform mounts a short-lived projected service account token. GoTrue only needs to read that file and send it as the assertion.
This complements the
private_key_jwtsupport added in #2932–#2936. That support covers custom OIDC providers, with assertions that GoTrue signs using a key it holds. Here the platform issues the assertion, so GoTrue holds no key at all. It also applies to the built-in Azure provider, so existing users' Azure identities are unchanged. The request shape is the same as in #2936: the assertion goes in the body, withAuthStyleInParams.How
OAuthProviderConfigurationgainsClientAssertionFile(client_assertion_file). Only the Azure provider uses it for now.ValidateOAuthClientAssertionvalidates a provider the same way asValidateOAuth, minus the secret.NewAzureProvideruses that validation and clears the secret when a file is configured.GetOAuthTokenadds the assertion parameters.example.envdocuments the new variable.Tests
internal/api/provider/azure_test.go:client_secret;internal/conf/configuration_test.go: the env var loads, and both validations behave as expected.go test ./internal/api/provider ./internal/conf,make staticandmake secpass locally.Verified end to end against Entra ID with a federated credential, using an AKS projected service account token. I'm happy to change the shape, for example to make it a generic per-provider option instead of Azure-only.