Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

reference-docs: add sso cli commands

Stojan Dimitrovski8df225664831
diff --git a/apps/docs/pages/guides/auth/sso/auth-sso-saml.mdx b/apps/docs/pages/guides/auth/sso/auth-sso-saml.mdx
index d5598cc9c7a..d900f03291d 100644
--- a/apps/docs/pages/guides/auth/sso/auth-sso-saml.mdx
+++ b/apps/docs/pages/guides/auth/sso/auth-sso-saml.mdx
@@ -21,6 +21,8 @@ If you're having issues with identity provider software not on this list, please
This guide requires the use of the [Supabase CLI](/docs/guides/cli). Please make sure you're using version v1.46.4 or higher. You can use `supabase -v` to see the currently installed version.
+You can use the `supabase sso` [subcommands](/docs/reference/cli/supabase-sso) to manage your project's configuration.
+
SAML 2.0 support is disabled by default on Supabase projects. You can configure this on the [Auth Providers](https://app.supabase.com/project/_/auth/providers) page on your project.
Please note that SAML 2.0 support is offered on tiers Pro and above. Check the [Pricing](https://supabase.com/pricing) page for more information.
@@ -67,7 +69,7 @@ Note that SLO (Single Logout) is not supported at this time with Supabase Auth a
Append `?download=true` to the Metadata URL to download the Metadata XML file. This is useful in cases where the identity provider requires a file.
-Alternatively, you can use the `supabase sso info --project-ref <your-project>` command to get setup information for your project.
+Alternatively, you can use the `supabase sso info --project-ref <your-project>` [command](/docs/reference/cli/supabase-sso-info) to get setup information for your project.
### User accounts and identities
@@ -129,7 +131,7 @@ CREATE POLICY "View organization settings."
## Managing SAML 2.0 connections
-Once you've enabled SAML 2.0 support on your project via the [Auth Providers](https://app.supabase.com/project/_/auth/providers) page in the dashboard, you can use the [Supabase CLI](/docs/guides/cli) to add, update, remove and view information about identity providers.
+Once you've enabled SAML 2.0 support on your project via the [Auth Providers](https://app.supabase.com/project/_/auth/providers) page in the dashboard, you can use the [Supabase CLI](/docs/reference/cli/supabase-sso) to add, update, remove and view information about identity providers.
### Add a connection
@@ -152,7 +154,7 @@ Commonly used SAML 2.0 Identity Providers that only support Metadata XML files:
- Google Workspaces (GSuite)
- Any self-hosted or on-prem identity provider behind a VPN
-Once you've obtained the SAML 2.0 Metadata XML file or URL you can establish a connection with your project's Supabase Auth server by using the [Supabase CLI](/docs/guides/cli):
+Once you've obtained the SAML 2.0 Metadata XML file or URL you can [establish a connection](/docs/reference/cli/supabase-sso-add) with your project's Supabase Auth server by running:
```bash
supabase sso add --type saml --project-ref <your-project> \
@@ -272,7 +274,7 @@ Most SAML 2.0 identity providers use Lightweight Directory Access Protocol (LDAP
### Remove a connection
-Once a connection to an identity provider is established, you can remove it by running:
+Once a connection to an identity provider is established, you can [remove it](/docs/reference/cli/supabase-sso-remove) by running:
```bash
supabase sso remove <provider-id> --project-ref <your-project>
@@ -282,7 +284,7 @@ If successful, the details of the removed identity provider will be shown. All u
If you need to reassign those user accounts to another identity provider, please [open a support ticket](https://app.supabase.com/support/new).
-A list of all registered identity providers can be displayed by running:
+A [list of all](/docs/reference/cli/supabase-sso-list) registered identity providers can be displayed by running:
```bash
supabase sso list --project-ref <your-project>
@@ -299,7 +301,7 @@ Commonly this is necessary when:
- Other SAML 2.0 Metadata attributes have changed, but it is still the same identity provider
- You are updating the domains or attribute mapping
-You can use the following command to update the configuration of an identity provider:
+You can use this command to [update](/docs/reference/cli/supabase-sso-update) the configuration of an identity provider:
```bash
supabase sso update <provider-id> --project-ref <your-project>
@@ -311,13 +313,13 @@ It is not possible to change the unique SAML identifier of the identity provider
### Retrieving information about a connection
-You can always obtain a list of all registered providers using:
+You can always obtain a [list](/docs/reference/cli/supabase-sso-list) of all registered providers using:
```bash
supabase sso list --project-ref <your-project>
```
-This list will only include basic information about each provider. To see all of the information about a provider you can use:
+This list will only include basic information about each provider. To see [all of the information](/docs/reference/cli/supabase-sso-show) about a provider you can use:
```bash
supabase sso show <provider-id> --project-ref <your-project>
diff --git a/spec/cli_v1_commands.yaml b/spec/cli_v1_commands.yaml
index 595ce8ff2d7..05f64930410 100644
--- a/spec/cli_v1_commands.yaml
+++ b/spec/cli_v1_commands.yaml
@@ -1,4 +1,4 @@
-clispec: '001'
+elispec: '001'
info:
id: cli
version: 1.42.0
@@ -45,6 +45,253 @@ flags:
description: path to a Supabase project directory
default_value: ''
commands:
+ - id: supabase-sso
+ title: supabase sso
+ summary: Manage SSO authentication for your project
+ description: |-
+ Manage SSO authentication for Supabase projects.
+ tags:
+ - management-api
+ links: []
+ subcommands:
+ - supabase-sso-list
+ - supabase-sso-show
+ - supabase-sso-add
+ - supabase-sso-remove
+ - supabase-sso-update
+ - supabase-sso-info
+ flags:
+ - id: project-ref
+ name: --project-ref <string>
+ description: Project ref of the Supabase project.
+ default_value: ''
+ type: string
+ required: true
+ inherit: true
+ - id: output
+ name: --output [ pretty | json | yaml | toml ]
+ description: Output format of the command, useful when using the CLI in scripts or CI workflows.
+ default_value: pretty
+ type: '[ pretty | json | yaml | toml ]'
+ inherit: true
+ accepted_values:
+ - name: pretty
+ value: pretty
+ type: '[ pretty | json | yaml | toml ]'
+ - name: json
+ value: json
+ type: '[ pretty | json | yaml | toml ]'
+ - name: yaml
+ value: yaml
+ type: '[ pretty | json | yaml | toml ]'
+ - name: toml
+ value: toml
+ type: '[ pretty | json | yaml | toml ]'
+ description: |-
+ Use only with certain commands to output the raw SAML 2.0 Metadata XML stored in your project's authentication configuration.
+ - id: supabase-sso-info
+ title: supabase sso info
+ summary: Show important SAML 2.0 information about your project
+ description: |-
+ Returns all of the important SSO information necessary for your project to be registered with a SAML 2.0 compatible identity provider.
+ tags:
+ - management-api
+ flags: []
+ links: []
+ examples:
+ - id: basic-usage
+ name: Show project information
+ code: |-
+ supabase sso info --project-ref abcdefghijklmnopqrst
+ response: |-
+ Information about your project's SAML 2.0 configuration.
+ - id: supabase-sso-add
+ title: supabase sso add
+ summary: Add a connection to a SSO identity provider
+ description: |-
+ Add and configure a new connection to a SSO identity provider to your Supabase project.
+ tags:
+ - management-api
+ examples:
+ - id: basic-usage
+ name: Add with Metadata URL
+ code: |-
+ supabase sso add \
+ --project-ref abcdefgijklmnopqrst \
+ --type saml \
+ --metadata-url 'https://...' \
+ --domains company.com
+ response: |-
+ Information about the added identity provider. You can use
+ company.com as the domain name on the frontend side to initiate a SSO
+ request to the identity provider.
+ - id: with-xml
+ name: Add with Metadata File
+ code: |-
+ supabase sso add \
+ --project-ref abcdefgijklmnopqrst \
+ --type saml \
+ --metadata-file /path/to/metadata/file.xml \
+ --domains company.com
+ response: |-
+ Information about the added identity provider. You can use
+ company.com as the domain name on the frontend side to initiate a SSO
+ request to the identity provider.
+ flags:
+ - id: type
+ name: --type saml
+ description: |-
+ Type of identity provider being added. Only SAML 2.0 supported at this time.
+ type: string
+ accepted_values:
+ - name: saml
+ type: string
+ required: true
+ - id: metadata-url
+ name: --metadata-url <URL>
+ description: |-
+ A URL (typically HTTPS) that points to a SAML 2.0 Metadata XML document describing the SAML features supported by the identity provider being added.
+ Mutually exclusive with --metadata-file.
+ type: string
+ required: true
+ - id: metadata-file
+ name: --metadata-file <path to file>
+ description: |
+ A path to a file containing a SAML 2.0 Metadata XML document describing the SAML features supported by the identity provider being added. Prefer using --metadata-url if possible.
+
+ Mutually exclusive with --metadata-url.
+ type: string
+ required: true
+ - id: domains
+ name: domains
+ description: |-
+ A comma separated list of email domains to associate with this identity provider. Used to quickly sign users in on the frontend by identifying the correct identity provider based on the email address of the user.
+ type: string
+ - id: attribute-mapping-file
+ name: attribute-mapping-file
+ type: string
+ description: |-
+ A file containing a JSON document describing the attribute mappings attached to this identity provider. User information contained in the SAML assertion will be mapped according to the rules laid out in this document.
+ - id: supabase-sso-remove
+ title: supabase sso remove <provider-id>
+ summary: Remove a connection to a SSO identity provider
+ description: |-
+ Remove a connection to an already added SSO identity provider. Removing the provider will prevent existing users from logging in. Please treat this command with care.
+ tags:
+ - management-api
+ links: []
+ flags: []
+ examples:
+ - id: basic-usage
+ name: Remove a provider
+ code: |-
+ supabase sso remove 6df4d73f-bf21-405f-a084-b11adf19fea5 \
+ --project-ref abcdefghijklmnopqrst
+ response: |-
+ Information about the removed identity provider. It's a good idea to
+ save this in case you need it later on.
+ - id: supabase-sso-update
+ title: supabase sso update <provider-id>
+ summary: Update the configuration of an identity provider
+ description: |-
+ Update the configuration settings of a already added SSO identity provider.
+ tags:
+ - management-api
+ links: []
+ examples:
+ - id: basic-usage
+ name: Replace domains
+ code: |-
+ supabase sso update 6df4d73f-bf21-405f-a084-b11adf19fea5 \
+ --project-ref abcdefghijklmnopqrst \
+ --domains new-company.com,new-company.net
+ response: |-
+ Information about the updated provider.
+ - id: add-domains
+ name: Add an additional domain
+ code: |-
+ supabase sso update 6df4d73f-bf21-405f-a084-b11adf19fea5 \
+ --project-ref abcdefghijklmnopqrst \
+ --add-domains company.net
+ response: |-
+ Information about the updated provider.
+ - id: remove-domains
+ name: Remove a domain
+ code: |-
+ supabase sso update 6df4d73f-bf21-405f-a084-b11adf19fea5 \
+ --project-ref abcdefghijklmnopqrst \
+ --remove-domains company.org
+ response: |-
+ Information about the updated provider.
+ flags:
+ - id: metadata-url
+ name: --metadata-url <URL>
+ description: |-
+ A URL (typically HTTPS) that points to a SAML 2.0 Metadata XML document describing the SAML features supported by the identity provider being added.
+ Mutually exclusive with --metadata-file.
+ type: string
+ - id: metadata-file
+ name: --metadata-file <path to file>
+ description: |
+ A path to a file containing a SAML 2.0 Metadata XML document describing the SAML features supported by the identity provider being added. Prefer using --metadata-url if possible.
+
+ Mutually exclusive with --metadata-url.
+ type: string
+ - id: domains
+ name: domains
+ description: |-
+ A comma separated list of email domains to associate with this identity provider. Used to quickly sign users in on the frontend by identifying the correct identity provider based on the email address of the user. When provided all of the domains already attached to the identity provider will be replaced with this list.
+ type: string
+ - id: add-domains
+ name: add-domains
+ description: |-
+ Associates these additional email domains to the existing set of domains. See --domains for a detailed explanation.
+ - id: remove-domains
+ name: remove-domains
+ description: |-
+ Removes these email domains from the existing set of domains. See --domains for a detailed explanation.
+ - id: attribute-mapping-file
+ name: attribute-mapping-file
+ type: string
+ description: |-
+ A file containing a JSON document describing the attribute mappings attached to this identity provider. User information contained in the SAML assertion will be mapped according to the rules laid out in this document.
+ - id: supabase-sso-list
+ title: supabase sso list
+ summary: Lists all connections to identity providers
+ description: |-
+ List all connections to a SSO identity provider to your Supabase project.
+ tags:
+ - management-api
+ links: []
+ flags: []
+ - id: supabase-sso-show
+ title: supabase sso show <provider-id>
+ summary: Show information about an identity provider.
+ description: |-
+ Provides the information about an established connection to an identity provider. You can use --metadata to obtain the raw SAML 2.0 Metadata XML document stored in your project's configuration.
+ tags:
+ - management-api
+ examples:
+ - id: basic-usage
+ name: Show information
+ code: |-
+ supabase sso show 6df4d73f-bf21-405f-a084-b11adf19fea5 \
+ --project-ref abcdefghijklmnopqrst
+ response: |-
+ Information about the identity provider in pretty output.
+ - id: metadata-output
+ name: Get raw SAML 2.0 Metadata XML
+ code: |-
+ supabase sso show 6df4d73f-bf21-405f-a084-b11adf19fea5 \
+ --project-ref abcdefghijklmnopqrst \
+ --metadata
+ response: |-
+ Raw SAML 2.0 XML assigned to this identity provider. This is the
+ version used in the authentication project, and if using a SAML 2.0
+ Metadata URL it may change depending on the caching information
+ contained within the metadata.
+ links: []
+ flags: []
- id: supabase-vanity-subdomains
title: supabase vanity-subdomains
summary: Manage vanity subdomains for Supabase projects
diff --git a/spec/client-libs-common.yml b/spec/client-libs-common.yml
index bcbfd839848..6ab88bc27af 100644
--- a/spec/client-libs-common.yml
+++ b/spec/client-libs-common.yml
@@ -72,6 +72,34 @@ commands:
title: supabase projects create
product: 'projects'
+ - id: supabase-sso
+ title: supabase sso
+ product: 'auth'
+
+ - id: supabase-sso-info
+ title: supabase sso info
+ product: 'auth'
+
+ - id: supabase-sso-list
+ title: supabase sso list
+ product: 'auth'
+
+ - id: supabase-sso-show
+ title: supabase sso show
+ product: 'auth'
+
+ - id: supabase-sso-add
+ title: supabase sso add
+ product: 'auth'
+
+ - id: supabase-sso-remove
+ title: supabase sso remove
+ product: 'auth'
+
+ - id: supabase-sso-update
+ title: supabase sso update
+ product: 'auth'
+
- id: supabase-orgs
title: supabase orgs
product: 'organizations'
diff --git a/spec/common-cli-sections.json b/spec/common-cli-sections.json
index ceb5c2eb7ea..e01f4d5ece2 100644
--- a/spec/common-cli-sections.json
+++ b/spec/common-cli-sections.json
@@ -286,6 +286,53 @@
}
]
},
+ {
+ "title": "Authentication",
+ "items": [
+ {
+ "id": "supabase-sso",
+ "title": "Manage SSO on your project",
+ "slug": "supabase-sso",
+ "type": "cli-command"
+ },
+ {
+ "id": "supabase-sso-list",
+ "title": "List all identity providers",
+ "slug": "supabase-sso-list",
+ "type": "cli-command"
+ },
+ {
+ "id": "supabase-sso-show",
+ "title": "Show information for an identity providers",
+ "slug": "supabase-sso-show",
+ "type": "cli-command"
+ },
+ {
+ "id": "supabase-sso-add",
+ "title": "Add an identity provider",
+ "slug": "supabase-sso-add",
+ "type": "cli-command"
+ },
+ {
+ "id": "supabase-sso-update",
+ "title": "Update an identity provider",
+ "slug": "supabase-sso-update",
+ "type": "cli-command"
+ },
+ {
+ "id": "supabase-sso-remove",
+ "title": "Remove an identity provider",
+ "slug": "supabase-sso-remove",
+ "type": "cli-command"
+ },
+ {
+ "id": "supabase-sso-info",
+ "title": "See your project's SSO information",
+ "slug": "supabase-sso-info",
+ "type": "cli-command"
+ }
+ ]
+ },
{
"title": "Custom Domains",
"items": [
diff --git a/spec/common-cli.yml b/spec/common-cli.yml
index bcbfd839848..1f635d28e92 100644
--- a/spec/common-cli.yml
+++ b/spec/common-cli.yml
@@ -187,3 +187,27 @@ commands:
- id: supabase-completion-bash
title: supabase completion bash
product: 'completion'
+
+ - id: supabase-sso
+ title: supabase sso
+ product: 'auth'
+
+ - id: supabase-sso-add
+ title: supabase sso add
+ product: 'auth'
+
+ - id: supabase-sso-remove
+ title: supabase sso remove
+ product: 'auth'
+
+ - id: supabase-sso-update
+ title: supabase sso update
+ product: 'auth'
+
+ - id: supabase-sso-list
+ title: supabase sso list
+ product: 'auth'
+
+ - id: supabase-sso-show
+ title: supabase sso show
+ product: 'auth'