docs(auth): document dedicated scope for SAML providers (#53859)

## What

Documents the SAML \`dedicated_scope\` option added in
[supabase/auth#2893](https://github.com/supabase/auth/pull/2893) and
exposed in the CLI in
[supabase/cli#7665](https://github.com/supabase/cli/pull/7665).

Some identity providers, notably Microsoft Entra, don't allow the same
entity ID in more than one application, so a project could connect only
one such app. A provider with a dedicated scope gets its own entity ID,
metadata URL, and ACS URL scoped to its provider ID.

## Changes

- `auth-sso-saml.mdx`: new "Use a dedicated scope for a connection"
section with the URL comparison, the `--dedicated-scope` flag, which
commands print the dedicated URLs, and a setup procedure for identity
providers (such as Okta) that need the URLs when the app is created. The
shared-URL table now links to it.
- `cli_v1_commands.yaml`: adds `--dedicated-scope` to `supabase sso
add`.

## Needs review

- The Entra-specific flow isn't verified. The procedure follows the Okta
workflow generically; it's unclear whether Entra rejects a second app
created with the shared entity ID.
- "Remove and add the connection again" to change scope is inferred,
because `sso update` doesn't accept the flag.
- No minimum CLI or Auth version is stated.
- The generated Management API reference isn't updated, since the
published spec doesn't document `dedicated_scope` yet.
- The self-hosted SAML page isn't checked.
- Not run: docs build, link and anchor checks, `test-the-docs`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Stojan DimitrovskiandClaude Sonnet 5.5 authored and GitHub committed 2026-11-23 14:10:06 +00:00
1 parent ba7d7727c2
commit ca8ee0b93e
2 files changed
+37

No files matched your search

@@ -74,6 +74,8 @@ Append `?download=true` to the Metadata URL to download the Metadata XML file. T
Alternatively, you can use the `supabase sso info --remote=<your-project>` [command](/docs/reference/cli/supabase-sso-info) to get setup information for your project.
These values are shared by every connection in your project. If your identity provider doesn't allow the same `EntityID` in more than one application, such as Microsoft Entra, use a [dedicated scope](#use-a-dedicated-scope-for-a-connection) for each connection.
### User accounts and identities
User accounts and identities created via SSO differ from regular (email, phone, password, social sign-in...) accounts in these ways:
@@ -260,6 +262,37 @@ Calling [`SignInWithSSO`](/docs/reference/csharp/auth-signinwithsso) starts the
</$Show>
</Tabs>
### Use a dedicated scope for a connection
By default, every SAML connection in a project shares one `EntityID`, Metadata URL, and ACS URL. Microsoft Entra requires a unique `EntityID` for each application in a tenant, so the shared values work for only one Entra application.
A connection with a dedicated scope has its own `EntityID`, Metadata URL, and ACS URL, so you can register one identity provider application for each connection.
| Name | Shared (default) | Dedicated scope |
| --------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `EntityID` and Metadata URL | `https://YOUR_PROJECT_REF.supabase.co/auth/v1/sso/saml/metadata` | `https://YOUR_PROJECT_REF.supabase.co/auth/v1/sso/YOUR_PROVIDER_ID/saml/metadata` |
| ACS URL | `https://YOUR_PROJECT_REF.supabase.co/auth/v1/sso/saml/acs` | `https://YOUR_PROJECT_REF.supabase.co/auth/v1/sso/YOUR_PROVIDER_ID/saml/acs` |
To set a dedicated scope, add the `--dedicated-scope` flag when you [add the connection](/docs/reference/cli/supabase-sso-add). You can't change it later with `supabase sso update`.
```bash
supabase sso add --type saml --remote=YOUR_PROJECT_REF \
--metadata-url 'https://company.com/idp/saml/metadata' \
--domains company.com \
--dedicated-scope
```
`supabase sso show YOUR_PROVIDER_ID --remote=YOUR_PROJECT_REF` prints the connection's `SP ENTITY ID` and `SP ACS URL`. `supabase sso info` prints only the shared values.
#### Set up the identity provider application
The dedicated URLs contain the provider ID, which exists only after you add the connection. If your identity provider needs the URLs when you create the application, such as Okta, start with the shared values and then switch:
1. Create the application in the identity provider with the shared `EntityID` and ACS URL from `supabase sso info`.
2. Add the connection with `--dedicated-scope`, using the application's Metadata URL.
3. Run `supabase sso show` and copy the `SP ENTITY ID` and `SP ACS URL`.
4. Edit the application to use those values.
### Understanding attribute mappings
When a user signs in using the SAML 2.0 Single Sign-On protocol, an XML document called the SAML Assertion is exchanged between the identity provider and Supabase Auth.
+4
View File
@@ -4389,6 +4389,10 @@ commands:
name: --attribute-mapping-file <string>
description: File containing a JSON mapping between SAML attributes to custom JWT claims.
default_value: ''
- id: dedicated-scope
name: --dedicated-scope
description: Scope the SAML entity ID, metadata URL and ACS URL to this identity provider instead of the shared project-wide URLs.
default_value: 'false'
- id: domains
name: --domains <strings>
description: Comma separated list of email domains to associate with the added identity provider.