Files
supabase/apps/studio
25120657db feat(sso): improve SSO management UX (safe deletion + invitation type selection) (#43615)
## feat(sso): improve SSO management UX (safe deletion + invitation type
selection)

This PR improves the SSO management experience by introducing a safer
deletion flow for SSO providers and allowing explicit control over
invitation authentication type.

## SSO Provider Deletion Improvements

The SSO provider deletion flow has been redesigned to better communicate
the impact of the action and prevent accidental destructive operations.

### UX Improvements

* Replace `ConfirmationModal` with `TextConfirmModal` in `SSOConfig`
* Require typing the SSO domain to confirm deletion
* Display the number of organization members authenticating via SSO who
will be removed
* Add destructive visual styling and clear warnings about irreversible
consequences
* Update confirmation button label to emphasize impact:

  * `I understand, delete SSO provider and members`

### Warning Content

The modal now clearly communicates:

* The domain being deleted
* That SSO authentication will be disabled
* That SSO-authenticated members will be permanently removed
* That those members must be re-invited to regain access

If SSO members exist, a highlighted destructive warning box shows:

```
X organization member(s) who authenticate via SSO will be permanently removed
```

### Implementation Details

* Add `useOrganizationMembersQuery` to fetch organization members
* Calculate SSO members by filtering `is_sso_user === true`
* Only display the member warning when the count > 0
* Modal uses `variant="destructive"` and `size="small"`

This pattern follows the existing **Delete organization** confirmation
flow.

### Initial Delete Support

This PR also introduces the underlying deletion functionality:

* Add `useSSOConfigDeleteMutation`
* Add delete button (trash icon, danger styling) in the SSO config
footer
* Layout mirrors `CustomDomainDelete` pattern:

  * delete button on the left
  * save/cancel actions on the right
* Success toast shown after deletion
* Form resets to explicit default values after deletion

## Invitation Type Selection

Organizations with SSO configured can now explicitly choose the
authentication method when inviting new members.

Previously, invitations always inherited the inviter's authentication
method. This made it difficult to support mixed authentication
organizations.

### New Invitation Options

When SSO is enabled, the invite dialog now shows an **Invitation type**
dropdown:

* **Automatic (based on your account)**
  Default behavior; inherits authentication method from the inviter.

* **Require SSO authentication**
  Sends an SSO invitation.

* **Email/password authentication**
  Sends a non-SSO invitation.

### Implementation Details

* Add `useOrgSSOConfigQuery` to detect if SSO is configured
* Add `requireSso` field to the form schema with enum:

  * `auto`
  * `sso`
  * `non-sso`
* Only display the dropdown when the organization has an SSO provider
* Transform form values before sending to the backend:

```
sso -> { requireSso: true }
non-sso -> { requireSso: false }
auto -> {} (omit parameter)
```

* Update `OrganizationCreateInvitationVariables` to include optional
`requireSso`
* Preserve backward compatibility by only sending the field when
explicitly set

## Bug Fixes

* Attribute mapping preset buttons (Azure, GSuite, Okta) now properly
mark the form as dirty so the save button becomes enabled
* Form reset after deletion now uses explicit default values instead of
the last saved state

## Problems Solved

This PR addresses several UX issues:

1. Deleting an SSO provider previously used a simple confirmation with
no explanation of impact
2. Users could not see how many members would be affected by deletion
3. The destructive and irreversible nature of the action was not
visually emphasized
4. Invitations always inherited the inviter's auth method
5. Organizations could not intentionally mix SSO and non-SSO users

## Types

TypeScript types in `api-types` were updated to support the new
`require_sso` parameter.

---------

Co-authored-by: Chris Stockton <chris.stockton@supabase.io>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-03-16 09:56:06 -07:00
..
2025-12-03 15:39:54 +08:00
2026-02-11 09:50:11 +01:00

Supabase Studio

A dashboard for managing your self-hosted Supabase project, and used on our hosted platform. Built with:

What's included

Studio is designed to work with existing deployments - either the local hosted, docker setup, or our CLI. It is not intended for managing the deployment and administration of projects - that's out of scope.

As such, the features exposed on Studio for existing deployments are limited to those which manage your database:

  • Table & SQL editors
    • Saved queries are unavailable
  • Database management
    • Policies, roles, extensions, replication
  • API documentation

Managing Project Settings

Project settings are managed outside of the Dashboard. If you use docker compose, you should manage the settings in your docker-compose file. If you're deploying Supabase to your own cloud, you should store your secrets and env vars in a vault or secrets manager.

How to contribute?

  • Branch from master and name your branches with the following structure
    • {type}/{branch_name}
      • Type: chore | fix | feature
      • The branch name is arbitrary — just make sure it summarizes the work.
  • When you send a PR to master, it will automatically tag members of the frontend team for review.
  • Review the contributing checklists to help test your feature before sending a PR.
  • The Dashboard is under active development. You should run git pull frequently to make sure you're up to date.

Developer Quickstart

Note

Supabase internal use: To develop on Studio locally with the backend services, see the instructions in the internal infrastructure repo.

# You'll need to be on Node v20
# in /studio

## For external contributors
pnpm install # install dependencies
pnpm run dev # start dev server

## For internal contributors
## First clone the private supabase/platform repo and follow instructions for setting up mise
mise studio  # Run from supabase/platform alongside `mise infra`

## For all
pnpm run test # run tests
pnpm run test -- --watch # run tests in watch mode

Running within a self-hosted environment

Follow the self-hosting guide to get started.

cd ..
cd docker
docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up

Once you've got that set up, update .env in the studio folder with the corresponding values.

POSTGRES_PASSWORD=
SUPABASE_ANON_KEY=
SUPABASE_SERVICE_KEY=

Then run the following commands to install dependencies and start the dashboard.

npm install
npm run dev

If you would like to configure different defaults for "Default Organization" and "Default Project", you will need to update the .env in the studio folder with the corresponding values.

DEFAULT_ORGANIZATION_NAME=
DEFAULT_PROJECT_NAME=