Repository navigation
Conversation
Lets a SAML SSO provider opt into using its own provider ID as part of its ACS URL and entity ID (which defaults to the SP metadata URL), instead of the URLs shared by every SAML provider in the project. The same signing key is still used. This is useful for IdPs that require a unique ACS URL/entity ID per connection, and isolates assertions issued for one connection from being replayed against another. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hf
commented
Oct 30, 2026
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The dedicated-scope guard in the ACS handler previously ran before ParseResponse, using the SSO provider resolved from an unauthenticated Issuer peeked out of the raw, unverified SAMLResponse XML in the IdP-initiated flow. Move that guard to after the assertion has been cryptographically validated, and require IdP-initiated requests on a dedicated-scope endpoint to carry an explicit, matching Destination rather than relying on the library's conditional check. Also log a WARN with the old/new value whenever dedicated_scope is toggled on an existing provider via the admin API, since it immediately changes the ACS URL/entity ID that provider expects. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
|
Addressed the security review findings on the
|
dedicated_scope effectively changes the entity ID this SP presents to the IdP (it defaults to the SP metadata URL, which becomes scoped to the provider's ID when enabled), so toggling it after the IdP has been configured would silently break the connection. Reject any attempt to change it on an existing provider with a clear error instead. Also move the column from sso_providers to saml_providers: it's a SAML-protocol detail (alongside entity_id/metadata_url/name_id_format) rather than provider-agnostic config like resource_id/disabled, and it's now exposed nested under `saml` in the admin API response to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Previously the explicit Destination check was only enforced on dedicated-scope ACS endpoints. Generalize it to every IdP-initiated response so the global, shared ACS endpoint doesn't implicitly accept assertions meant for another endpoint, asserting the invariant ourselves rather than relying solely on crewjam/saml's internal Recipient check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
staaldraad
approved these changes
Nov 4, 2026
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.
Some SAML identity providers (famously Entra) don't allow the same entity ID to be registered with multiple "applications," making Supabase Auth usable only with one application. Some enterprise use-cases are therefore hard to build.
In this PR we add a
dedicated_scopeoptional boolean on an SSO provider, which in SAML means that the provider can only be used via its own new Entity ID and URLs scoped to the provider's unique ID.This way in Entra you can register many SPs served by the same Supabase Auth project by creating them with the
dedicated_scopeboolean.Notes:
dedicated_scopeboolean to SAML SSO providers. When set, that provider's ACS URL and SP metadata URL (and, by extension, the entity ID GoTrue presents to the IdP, which defaults to the metadata URL) are scoped to the provider's own ID, instead of using the URLs shared by every SAML provider in the project. The same signing key/certificate is still used.GET /sso/{sso_provider_id}/saml/metadataandPOST /sso/{sso_provider_id}/saml/acsalongside the existing shared/sso/saml/*endpoints; the ACS handler rejects a provider hitting the wrong endpoint for its scope setting.dedicated_scopecan be set on create/update via the admin SSO provider API and is documented inopenapi.yaml.