Documentation Index
Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Lovable Cloud supports SAML 2.0 single sign-on (SSO) for your app’s end users. When enabled, users whose email domain matches your configuration are redirected to your identity provider (IdP), authenticate there, and return to your app already signed in. It appears alongside your other sign-in methods under Cloud → Users → Auth settings. Setting up SAML is a two-way exchange between Lovable and your identity provider:- Lovable → IdP: Copy two service-provider values (ACS URL and Audience URI) from Lovable into your IdP’s SAML application.
- IdP → Lovable: Copy your IdP’s metadata URL back into Lovable, along with the email domains that should use this IdP.
Why use SAML SSO
- Centralized access management: Provision and de-provision in your identity provider, your app inherits those decisions
- Inherit your organization’s MFA, conditional access, and device policies
- Frequently required by enterprise customers during security and compliance reviews
- Simpler sign-in for employees using their existing work accounts
Common use cases
- B2B SaaS products selling to enterprise customers
- Internal tools where employees should sign in with their corporate identity
- Apps shipped to a single customer who requires their identity provider for access
Prerequisites
- A Lovable Cloud project (auth must be Lovable-managed)
- SSO must be allowed by your workspace auth policy
- Admin access to a SAML 2.0 identity provider (Okta, Microsoft Entra ID, Google Workspace, OneLogin, JumpCloud) that publishes a public metadata URL
- The list of email domains to route to that identity provider, for example
acme.com, acme.co.uk
Set up SAML SSO
Complete the following steps in order.In Lovable: Open the setup form and copy the SP values
- Ask Lovable in chat
- Use the Cloud tab
- ACS URL:
https://<project-ref>.supabase.co/auth/v1/sso/saml/acs - Audience URI:
https://<project-ref>.supabase.co/auth/v1/sso/saml/metadata
In your IdP: Create the SAML app and copy the metadata URL
| Lovable value | Common IdP field names | What to enter |
|---|---|---|
| ACS URL (from Step 1) | Single Sign-On URL, SSO URL, Reply URL, Assertion Consumer Service URL | Paste the ACS URL |
| Audience URI (from Step 1) | SP Entity ID, Audience URI, Identifier | Paste the Audience URI |
| Name ID format | Name ID format, Name identifier format | EmailAddress |
| Email attribute | Attribute Statements, Claims, User Attributes | Map the user’s primary email to an email attribute |
- Assign the users or groups who should be able to sign in.
- Copy your IdP’s metadata URL, you will need it in Step 3.
Back in Lovable: Paste the metadata URL and email domains
- SAML metadata URL: Paste the metadata URL you copied from your identity provider.
- Email domains: Comma-separated list of domains to route to this identity provider, for example
acme.com, acme.co.uk.
Add a sign-in entry point in your app
Test the sign-in flow
- Open your published app in an incognito window.
- Go to the sign-in page.
- Enter an email address at one of your configured domains (for example,
you@acme.com). - You should be redirected to your identity provider, authenticate there, and return to your app signed in.
Manage your SAML configuration
- Disable SSO. Toggle Enable SAML 2.0 single sign-on off. Existing users keep their accounts but can no longer sign in via SAML. They will need another enabled method.
- Certificate rotation. If your identity provider rotates its signing certificate, the metadata URL usually stays the same and Lovable re-fetches it. If the URL itself changes, update it here.
- Edit the configuration. Re-run the project chat flow or change the fields in the Cloud tab. Updates replace the existing connection.
Limitations
- One SAML provider per project. You cannot connect two identity providers to the same project.
- SP-initiated only. No IdP-initiated tile launches.
- Metadata URL only. No XML upload or manual SP configuration.
- No attribute-mapping UI. The user’s email comes from the SAML assertion as-is. Make sure your identity provider sends a stable email value.
- No SCIM provisioning. Users are created on first successful sign-in (just-in-time). Removing a user in your identity provider prevents future sign-ins, but stale rows may remain in your project’s user table.
- Domains route, they do not enforce. Configuring
acme.comdoes not disable email or Google sign-in foracme.comusers, it only routes them to your identity provider when they sign in using SSO. To enforce SSO-only, disable the other sign-in methods.
Troubleshooting
'Invalid metadata' when saving
'Invalid metadata' when saving
User is not redirected to the IdP
User is not redirected to the IdP
Sign-in succeeds at the IdP but the user lands back on the sign-in page
Sign-in succeeds at the IdP but the user lands back on the sign-in page
- Your app isn’t reading the session after the redirect. Make sure you have an
onAuthStateChangelistener and that the SSO callback route is handled. - Your app’s URL isn’t in the redirect allow-list. If unsure, ask Lovable to:
Sign-in fails after IdP login
Sign-in fails after IdP login
Invalid SAML response
Invalid SAML response
Email claim missing (Microsoft Entra ID)
Email claim missing (Microsoft Entra ID)
email to user.mail. If user.mail is empty, use user.userprincipalname.FAQ
How is Cloud SAML SSO different from the workspace-level SSO?
How is Cloud SAML SSO different from the workspace-level SSO?
Which SSO providers does Cloud SAML SSO support?
Which SSO providers does Cloud SAML SSO support?
Does Lovable also support OIDC for Cloud apps?
Does Lovable also support OIDC for Cloud apps?
Can I have multiple SAML providers for the same project?
Can I have multiple SAML providers for the same project?
Does Lovable support IdP-initiated SSO?
Does Lovable support IdP-initiated SSO?
Does Lovable support JIT user provisioning?
Does Lovable support JIT user provisioning?
Does Lovable support SCIM for Cloud project SAML SSO?
Does Lovable support SCIM for Cloud project SAML SSO?
Can I edit the SAML configuration after saving?
Can I edit the SAML configuration after saving?
Does enabling SAML disable other sign-in methods?
Does enabling SAML disable other sign-in methods?