Configuring Entra ID SAML SSO with Supabase Cloud
This guide walks through configuring Microsoft Entra ID (formerly Azure AD) as a SAML identity provider for your Supabase Cloud project to enable SSO authentication with sfp pro CLI/Codev
Prerequisites
Before starting the configuration, ensure you have:
Supabase Requirements:
Supabase Pro plan or higher (SAML support requires Pro tier)
Write access to your Supabase project
Supabase CLI version 1.46.4 or higher
Your project reference ID and anon key
Entra ID Requirements:
Admin access to your Microsoft Entra ID tenant
At least one verified domain in your Entra ID tenant
Ability to create Enterprise Applications
sfp Requirements:
sfp CLI installed
Access to your sfp server instance
sfp server URL (e.g.,
https://your-sfp-server.com)
Step 1: Enable SAML in Supabase Dashboard
Navigate to your Supabase Dashboard
Select your project
Go to Authentication → Providers
Locate SAML 2.0 section
Toggle Enable SAML 2.0 to enabled
Save the configuration
Step 2: Note Your Supabase Configuration
Gather the following information from your Supabase project:
Step 3: Configure Entra ID Enterprise Application
Create the Application
Sign in to Azure Portal
Navigate to Microsoft Entra ID → Enterprise applications
Click New application → Create your own application
Select Integrate any other application you don't find in the gallery (Non-gallery)
Name it (e.g., "sfp SSO Production")
Click Create
Configure SAML Settings
In your application, go to Single sign-on
Select SAML as the method
Click Edit in Basic SAML Configuration
Configure these URLs (replace
<project-ref>with your actual reference):
Identifier (Entity ID)
https://<project-ref>.supabase.co/auth/v1/sso/saml/metadata
Reply URL (ACS URL)
https://<project-ref>.supabase.co/auth/v1/sso/saml/acs
Sign on URL
https://<project-ref>.supabase.co
Click Save
Configure Attributes and Claims
In Attributes & Claims, click Edit
Ensure these claims are configured:
Unique User Identifier
user.mail
emailaddress
user.mail
displayname
user.displayname
givenname
user.givenname
surname
user.surname
Download Federation Metadata
In SAML Certificates section
Download Federation Metadata XML
Save the file locally
Assign Users
Go to Users and groups
Click Add user/group
Select users who need sfp access
Click Assign
Step 4: Configure Supabase with Entra ID
Install Supabase CLI
Login to Supabase
Add the SAML Provider
Using your downloaded metadata file and your organization's domain:
Example:
Configure Attribute Mappings
Create attribute-mapping.json:
Apply the mapping:
Verify Configuration
Ensure you see your domain listed in the output.
Step 5: Configure sfp CLI
Configure sfp to use your Supabase instance:
Example with actual values:
Step 6: Test SAML Authentication
Test the complete flow with sfp:
Example:
This command will:
Contact your Supabase instance
Identify the SAML provider for your domain
Redirect you to Entra ID for authentication
Upon successful login, create a JWT token for sfp server access
Troubleshooting
Common Issues
"No SSO provider assigned for this domain"
Verify domain configuration:
supabase sso list --project-ref <your-project-ref>Ensure the domain matches exactly what you configured
Check that SAML is enabled in Supabase dashboard
"SAML assertion does not contain email address"
Verify email claim is configured in Entra ID
Check attribute mappings include email
Ensure assigned users have email addresses in Entra ID
Authentication succeeds but sfp login fails
Verify sfp config points to correct Supabase instance:
Ensure the user's email domain matches the configured SSO domain
Certificate errors
Update metadata if certificates rotated:
Debug Commands
Managing Multiple Environments
For different environments (dev, staging, production), you can:
Use environment variables:
Or switch sfp configuration:
Security Considerations
Protect your anon key: While public, avoid committing it to version control
Use separate Supabase projects for different environments
Regularly rotate certificates in Entra ID
Monitor authentication logs in both Supabase and Entra ID
Implement proper RLS policies in your Supabase database
Next Steps
After successful configuration:
Document the SSO domain for your team
Create user onboarding documentation
Set up monitoring for authentication failures
Plan for certificate rotation schedules
Consider implementing automated user provisioning
Last updated