Multiple SSO Providers
Many enterprises need multiple single sign-on (SSO) providers configured within Supabase to support different environments, teams, or organizational structures. This guide explains when and how to set up multiple providers effectively.
Why multiple SSO providers?#
Common scenarios requiring multiple SSO providers include:
- Multiple environments: Separate Dev, Staging, and Production organizations
- Team separation: Different business units or departments
- Migration: Transitioning from one identity provider to another
- Acquisitions: Integrating subsidiaries with different identity systems
- Testing: Isolated test environments alongside production
Key concept: IDP-initiated enables unlimited providers per domain#
The traditional challenge with multiple SAML apps is domain conflicts. With SP-initiated flow only, each SAML app requires a unique email domain. Since all your employees use the same domain (e.g., company.com), this creates a problem.
Solution: Use identity provider (IdP)-initiated flow, which doesn't require domain configuration. You can create unlimited SAML apps under the same domain.
Recommended pattern
Configure each environment as IdP-initiated only (no domains). Users access each environment through different app tiles in your identity provider.
For technical details, see the Understanding SSO Login Flows guide.
Use case 1: Multiple environments (dev/staging/prod)#
This is the most common enterprise pattern and the primary use case for IDP-initiated flow.
The challenge#
You have three Supabase organizations:
- Development (
dev-org) - Staging (
staging-org) - Production (
prod-org)
All employees use company.com email addresses. You need separate SSO configurations for each environment.
The solution#
Create three separate SAML apps in your identity provider, each pointing to a different Supabase organization.
In your identity provider (Okta, Azure AD, Google Workspace)#
-
Create "Supabase Dev" SAML app
- Configure with Dev organization's ACS URL
- Assign developers and testers
- Deploy app tile labeled "Supabase Dev"
-
Create "Supabase Staging" SAML app
- Configure with Staging organization's ACS URL
- Assign QA team and release managers
- Deploy app tile labeled "Supabase Staging"
-
Create "Supabase Production" SAML app
- Configure with Production organization's ACS URL
- Assign production users only
- Deploy app tile labeled "Supabase Production"
In each Supabase organization#
- Navigate to the SSO settings section of the dashboard
- Enable Single Sign-On
- Leave Enable SP-initiated login "OFF", this is critical
- Configure metadata from the corresponding IDP app
- Set up attribute mappings
- Configure auto-join if desired
Result#
- Users click the appropriate app tile for the environment they need
- No domain conflicts (all apps use
company.com) - Clean isolation between environments
- Each environment can have different user assignments and roles
Configuration example#
Here's how the three configurations differ:
| Environment | Organization | IDP App Name | ACS URL |
|---|---|---|---|
| Dev | dev | "Supabase Dev" | https://...dev-org.../saml/acs |
| Staging | staging | "Supabase Staging" | https://...staging-org.../saml/acs |
| Production | prod | "Supabase Prod" | https://...prod-org.../saml/acs |
Each organization#
- SP-initiated: OFF (no domains configured)
- IDP-initiated: ON (automatic, no configuration needed)
- Auto-join: Your preference (typically enabled for dev, disabled for prod)
Use case 2: Different teams or business units#
Some organizations need to isolate teams within separate Supabase organizations.
Example scenario#
- Engineering team uses
engineering-org - Data team uses
data-org - Both teams have
company.comemails
Configuration approach#
Option A: IDP-initiated with different app tiles#
Create separate SAML apps in your IDP:
- "Supabase Engineering" → Points to
engineering-org - "Supabase Data" → Points to
data-org
Assign appropriate users to each app. Users only see the tiles they're assigned to.
Option B: Both IDP and SP-initiated with role-based routing#
Configure both organizations with SP-initiated enabled using the same domain:
- Both organizations add
company.comas a domain - Users can log in via SP-initiated at supabase.com
- System routes based on org membership (first match wins)
- Also provide IDP tiles for explicit routing
SP-initiated routing with multiple providers
When multiple organizations use SP-initiated with the same domain, the first provider where the user is a member will be used. This can cause confusion. IDP-initiated is recommended for clarity.
Use case 3: Migration from one IDP to another#
When migrating from one identity provider to another, multiple providers help ensure a smooth transition.
Migration workflow#
Phase 1: Dual configuration#
- Configure new IDP as additional SSO provider
- Keep existing IDP active
- Test new IDP with small group
- Both providers operational simultaneously
Phase 2: Gradual rollout#
- Migrate users in batches to new IDP
- Update app tile assignments
- Monitor for issues
- Keep old IDP as fallback
Phase 3: Cutover#
- Move all users to new IDP
- Verify no users depend on old IDP
- Disable (don't delete) old IDP provider
- Monitor for any issues
Phase 4: Cleanup#
- After verification period (1-2 weeks)
- Delete old IDP provider
- Update documentation
Always maintain at least one non-SSO owner account during migrations to ensure you never lose access to the organization.
Use case 4: Acquisitions and subsidiaries#
Organizations with multiple email domains need provider configurations for each domain.
Example scenario#
- Parent company:
parent.com - Subsidiary 1:
subsidiary1.com - Subsidiary 2:
subsidiary2.com
All authenticate through the same central IDP but use different email domains.
Configuration approach#
Option A: Single provider with multiple domains (SP-initiated)#
- Enable SSO with SP-initiated flow
- Add all domains:
parent.com,subsidiary1.com,subsidiary2.com - Configure single IDP metadata
- Users with any matching domain can log in via supabase.com
Option B: Separate providers per subsidiary (IDP-initiated)#
- Create separate SAML apps for each entity
- Configure as IDP-initiated only
- Assign users based on their subsidiary
- More isolation, clearer organization boundaries
Step-by-step setup guide#
For IDP-initiated multi-environment pattern#
This is the recommended pattern for most enterprises.
Step 1: Plan your environments#
Document:
- Organization names and slugs
- Environment purposes (dev, staging, prod)
- Which users need access to which environments
- Default roles for each environment
Step 2: Create SAML apps in your IDP#
For each environment, follow your provider-specific guide to create a SAML app:
Naming convention example#
- "Supabase - Production"
- "Supabase - Staging"
- "Supabase - Development"
Use consistent naming to help users identify the right environment.
Step 3: Configure each Supabase organization#
For each organization:
- Navigate to the SSO settings section of the dashboard
- Enable Single Sign-On
- Verify Enable SP-initiated login is "OFF"
- Upload or paste metadata from the corresponding IDP app
- Configure attribute mappings:
- Email (required): Map to
email - Name (optional): Map to
nameordisplayName
- Email (required): Map to
- Configure auto-join settings:
- Dev: Usually enabled with "Developer" role
- Staging: Usually enabled with "Developer" role
- Prod: Usually disabled (explicit invitations only)
- Save configuration
Step 4: Test each environment separately#
For each environment:
- Open your IDP dashboard (Okta, Azure, Google)
- Click the corresponding app tile
- Verify redirect to correct Supabase organization
- Check that user information is populated correctly
- Verify auto-join behavior (if enabled)
See the SSO Testing and Best Practices guide for comprehensive testing procedures.
Step 5: Assign users in your IDP#
Configure app assignments in your IDP:
- Production: Only production users (restrictive)
- Staging: QA team, release managers, senior engineers
- Development: All engineers and testers (permissive)
Users only see app tiles they're assigned to.
Step 6: Document and communicate#
Create documentation for your team:
- Which app tile corresponds to which environment
- Access request process for each environment
- Naming conventions and organization structure
- Emergency access procedures (non-SSO owner account)
User access management#
IDP app assignment strategies#
Per-environment access control#
Control who can access each environment by managing app assignments in your IDP:
1Engineering Team:2├─ Supabase Dev (assigned) ✅3├─ Supabase Staging (assigned) ✅4└─ Supabase Prod (assigned) ✅56QA Team:7├─ Supabase Dev (assigned) ✅8├─ Supabase Staging (assigned) ✅9└─ Supabase Prod (NOT assigned) ❌1011Contractors:12├─ Supabase Dev (assigned) ✅13├─ Supabase Staging (NOT assigned) ❌14└─ Supabase Prod (NOT assigned) ❌Role assignment patterns#
Option 1: Different default roles per environment#
- Dev: Auto-join with "Administrator" role (developers need full control)
- Staging: Auto-join with "Developer" role
- Prod: No auto-join, explicit invitations with "Read-only" or "Developer"
Option 2: Consistent roles, manual promotion#
- All environments: Auto-join with "Developer" role
- Promote to "Administrator" or "Owner" manually as needed
- Provides consistent baseline, explicit elevation
Option 3: No auto-join, explicit control#
- All environments: Auto-join disabled
- Send explicit invitations with appropriate roles
- Maximum control, more management overhead
Choose based on your organization's security posture and operational preferences.
Best practices#
Naming conventions#
IDP app names#
Use consistent, descriptive names that clearly indicate the environment:
- ✅ "Supabase - Production"
- ✅ "Supabase Prod"
- ❌ "Supabase" (ambiguous)
- ❌ "SUPA_PROD" (unclear abbreviation)
Supabase organization names#
Match your IDP app names when possible:
- IDP app: "Supabase - Production" → Org:
acme-production - IDP app: "Supabase - Staging" → Org:
acme-staging - IDP app: "Supabase - Dev" → Org:
acme-development
Configuration synchronization#
Keep critical settings synchronized across environments:
- Attribute mappings: Should be identical across all providers
- Certificate settings: Coordinate renewals across all environments
- Safety accounts: Each org needs a non-SSO owner account
Configuration drift checklist#
- Attribute mappings match across environments
- Certificate expiration dates documented for all providers
- Non-SSO owner accounts exist in all organizations
- Auto-join settings are intentional (not accidental)
- Default roles appropriate for each environment
Testing in lower environments first#
Always test SSO changes in non-production environments:
- Make change in Dev environment
- Test thoroughly (see testing guide)
- Deploy to Staging and verify
- Monitor for issues (1-2 days)
- Deploy to Production during low-usage period
- Monitor closely after production deployment
Security considerations#
Environment isolation#
- Never reuse metadata between environments (security risk)
- Each environment should have unique ACS URLs
- Verify IDP app assignments are correct (don't give prod access accidentally)
Access reviews#
- Quarterly review of who has access to production
- Verify IDP app assignments are up to date
- Remove access for users who have changed roles
- Audit auto-join configurations (still appropriate?)
Break-glass access#
Each organization must have at least one non-SSO owner account:
- Create dedicated "break-glass" accounts
- Store credentials in secure password manager
- Test these accounts regularly (quarterly)
- Document emergency access procedures
Troubleshooting#
Users accessing the wrong environment#
Symptom#
User clicks "Supabase Prod" tile but sees the dev environment.
Causes#
- Metadata configured incorrectly (swapped between environments)
- ACS URL points to wrong organization
- User has bookmarked the wrong organization
Solution#
- Verify ACS URL in IDP app configuration
- Compare metadata in Supabase SSO settings
- Check that organization slug matches expected environment
- Have user clear browser cookies and try again
- Verify user is clicking correct app tile
Configuration drift between environments#
Symptom#
SSO works in dev but fails in staging or production.
Causes#
- Attribute mappings differ between providers
- Certificate expired in one environment but not others
- Domain configuration inconsistent (if using SP-initiated)
Solution#
- Compare SSO configurations side-by-side
- Check attribute mappings are identical
- Verify certificate expiration dates
- Test with same user account across all environments
- Review IDP audit logs for authentication failures
Users don't see expected app tiles#
Symptom#
User cannot find "Supabase Staging" tile in IDP dashboard.
Causes#
- User not assigned to the app in IDP
- App not deployed/published in IDP
- User looking in wrong place (different IDP portal)
Solution#
- Verify app assignment in IDP admin console
- Check app is published/active
- Confirm user has logged out and back into IDP
- Verify user is checking correct IDP portal (some organizations have multiple)
Auto-join adding users to wrong organization#
Symptom#
User joins dev environment when they should join production.
Cause#
User clicked wrong app tile, auto-join is enabled.
Prevention#
- Disable auto-join in production (explicit invitations only)
- Use clear app tile naming
- Document which tile corresponds to which environment
- Consider using different IDP groups for different environments
Remediation#
- Remove user from incorrect organization
- Send explicit invitation to correct organization
- Educate user on correct app tile to use
- Consider disabling auto-join to prevent recurrence
Multiple organizations with same domain (SP-initiated confusion)#
Symptom#
With SP-initiated enabled and same domain in multiple organizations, users get routed to unexpected organization.
Cause#
SP-initiated routing uses first matching provider.
Solution#
- Recommended: Switch to IDP-initiated only (disable SP-initiated)
- Remove domain configuration from all but one organization
- Provide clear IDP app tiles for explicit routing
- Document which organization users should access via SP-initiated
Migration from single to multiple providers#
If you currently have a single SSO provider and need to add more:
Phase 1: Planning#
- Decide which pattern to use (environments, teams, etc.)
- Document new organization structure
- Identify users for each environment
- Plan user communication strategy
Phase 2: Create new organizations#
- Create additional Supabase organizations
- Configure projects within each organization
- Migrate data if needed (see project transfer)
Phase 3: Configure SSO providers#
- Create additional SAML apps in your IDP
- Configure SSO in each new organization
- Start with auto-join disabled
- Test with small group
Phase 4: Migrate users#
- Communicate changes to users
- Assign users to appropriate IDP apps
- Test that users can access correct environments
- Enable auto-join if desired
Phase 5: Decommission old configuration (if applicable)#
- Migrate all users to new structure
- Verify no one depends on old configuration
- Disable old SSO provider
- Monitor for issues
- Delete after verification period
Next steps#
- Configure your IDP: Follow your provider-specific guide
- Test thoroughly: Review SSO Testing and Best Practices
- Understand login flows: Read Understanding SSO Login Flows
- Choose the right flow: See Choosing the Right Login Flow