Skip to main content
This page documents SAML SSO for your app’s end users. It is configured per project under More → Users → Settings.Looking for SSO for your team’s access to Lovable itself? See Set up workspace single sign-on (SSO). Building an internal tool for workspace members? They may not need SAML at all: see Reuse Lovable workspace identity in your app.
Your app’s built-in backend supports SAML 2.0 single sign-on (SSO) for your app’s users. When you enable it, users whose email domain matches your configuration are redirected to your identity provider (IdP), sign in there, and return to your app already signed in. SAML SSO hands sign-in control to your customer’s IT team. The IT team adds and removes people in their identity provider, and SAML sign-in follows those decisions along with their multi-factor authentication (MFA), conditional access, and device policies. Enterprise customers often require SAML SSO during a security review. SAML SSO fits products you sell to enterprises, internal tools where employees sign in with their corporate identity, and apps built for a single customer who requires their own identity provider. If you only need consumer sign-in, use email, Google, Apple, or Microsoft sign-in instead.
Service provider (SP)-initiated sign-in only. Users must start sign-in from your app. IdP-initiated SSO (starting from a tile in the IdP’s dashboard) is not supported for your app’s end users. It is available for workspace SSO.

Prerequisites

You need the following before starting:
  • A project on the built-in backend (auth must be Lovable-managed)
  • SSO must be allowed by your workspace’s App login methods policy. The policy exists on Business and Enterprise workspaces. On other plans, all methods are allowed.
  • Admin access to a SAML 2.0 identity provider (Okta, Microsoft Entra ID, Google Workspace, OneLogin, JumpCloud) that publishes a public metadata URL. When the identity provider belongs to your customer, you send their administrator the ACS URL and Audience URI from Lovable. The administrator completes the identity-provider steps and sends you the metadata URL.
  • The list of email domains to route to that identity provider, for example yourdomain.com, yourdomain.co.uk

Set up SAML SSO

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.
Complete the steps in order.
1

In Lovable: Open the setup form and copy the SP values

You can do this in the project chat or under More → Users.
In your project chat, ask:
Lovable opens an interactive Configure SAML SSO form. The top of the form shows your project’s ACS URL and Audience URI (SP Entity ID). Leave the form open. You fill in the metadata URL and domains in step 3.
Copy both URLs.
If you already have your IdP’s metadata URL when you start, include it in your prompt. Lovable pre-fills the form, so you only confirm it:
2

In your IdP: Create the SAML app and copy the metadata URL

In your identity provider, create a new SAML 2.0 application. Exact steps and field names vary by provider. Use this mapping:Then:
  • Assign the users or groups who should be able to sign in.
  • Copy your IdP’s metadata URL. You need it in step 3.
For provider-specific steps, see your identity provider’s documentation.
3

Back in Lovable: Paste the metadata URL and email domains

Return to the form you opened in Step 1.
  • SAML metadata URL: Paste the metadata URL you copied from your identity provider.
  • Domains (Email domain(s) in the chat form): comma-separated list of email domains to route to this identity provider, for example yourdomain.com, yourdomain.co.uk.
Click Configure SAML on the card in the chat, or Save in the Users view. Users at those domains can now sign in through your SAML provider.
4

Add a sign-in entry point in your app

Enabling SAML does not change your app’s sign-in page. The page still needs an entry point that starts the SSO flow.If you enabled SAML in the Users view, Lovable already sent a message to the project chat on your behalf to add SAML sign-in to your app. Otherwise, ask Lovable in the project chat to add it:
Lovable adds the SSO option to your sign-in page. Next, test the sign-in flow.

Test the sign-in flow

  1. Open your published app in an incognito window.
  2. Go to the sign-in page.
  3. Enter an email address at one of your configured domains (for example, you@yourdomain.com).
  4. Sign in at your identity provider. You return to your app, signed in.
If a user enters an email at a domain that is not in your SAML configuration, they can use the other sign-in methods you have enabled, such as email or Google.

Manage your SAML configuration

You can change the SAML setup at any time:
  • Disable SSO. Disable the Enable SAML 2.0 single sign-on toggle. Lovable then sends a message to the project chat on your behalf to remove SAML sign-in from your app. Existing users keep their accounts but can no longer sign in through SAML, so they 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 under More → Users → Settings → SAML SSO. Updates replace the existing connection.

Limitations

SAML SSO for apps has these limits:
  • 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 stops their future SAML sign-ins, but the user can still appear in your project’s user list. The user can still sign in with any other method you have enabled.
  • Domains route, they do not enforce. Configuring yourdomain.com does not disable email or Google sign-in for yourdomain.com users. Domain routing only sends them to your identity provider when they sign in using SSO. To enforce SSO-only, disable the other sign-in methods.

Troubleshooting

The metadata URL must return SAML metadata XML and be reachable from the public internet.
The user’s email domain is not in your Domains list, or they used a method (Google or email) that bypasses domain routing.
Your app does not finish the sign-in after the identity provider sends the user back. The usual causes are:
  • Your app does not read the new session after the redirect, or does not handle the SSO callback route.
  • Your app’s address is missing from your project’s redirect URLs.
To fix both, ask Lovable in the project chat:
The SAML assertion is missing an email, or the ACS URL or Audience URI in your IdP does not exactly match the values shown in Lovable’s Advanced section. Re-check both.
The clocks of your IdP and Lovable disagree, or the signing certificate does not match. Re-fetch the metadata URL or correct your IdP’s clock.
Map email to user.mail. If user.mail is empty, use user.userprincipalname.

FAQ

Workspace-level SSO controls how your team logs in to Lovable (the product). The SAML SSO described on this page controls how end users log in to your app. See Set up single sign-on (SSO) for the workspace-level feature.
Any SAML 2.0-compliant IdP that publishes a metadata URL: Okta, Microsoft Entra ID, Google Workspace, OneLogin, JumpCloud, Auth0 (SAML mode), and others.
Yes. Connect an OpenID Connect provider under More → Users → Settings → OIDC. See Add OpenID Connect (OIDC) sign-in to your app.
No. Each project connects to one SAML provider.
No. App end-user SSO is SP-initiated only: users must start sign-in from your app.IdP-initiated SAML is available for workspace SSO (your team’s login to Lovable). See Set up workspace single sign-on (SSO).
Yes. Users are created the first time they successfully sign in through SAML.
No. App SAML SSO has no SCIM provisioning. Manage user lifecycle in your IdP. When you remove a user there, their future SAML sign-ins are blocked. The user can still sign in with any other method you have enabled.
Yes. Re-run the chat flow or change the fields in the UI. Updates replace the existing connection.
No. Other methods stay enabled unless you disable them. To enforce SSO-only sign-in, disable email, Google, and any other methods you do not want.