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.
In Lovable: Open the setup form and copy the SP values
- Ask Lovable in the project chat
- Use the Users view
In your IdP: Create the SAML app and copy the metadata URL
- Assign the users or groups who should be able to sign in.
- Copy your IdP’s metadata URL. You 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.
- 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.
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@yourdomain.com). - Sign in at your identity provider. You return to your app, signed in.
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.comdoes not disable email or Google sign-in foryourdomain.comusers. 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
'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 returns to the sign-in page
Sign-in succeeds at the IdP but the user returns to the sign-in page
- 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.
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 app SAML SSO different from the workspace-level SSO?
How is app SAML SSO different from the workspace-level SSO?
Which SSO providers does app SAML SSO support?
Which SSO providers does app SAML SSO support?
Does Lovable also support OIDC for apps?
Does Lovable also support OIDC for apps?
Can I have multiple SAML providers for the same project?
Can I have multiple SAML providers for the same project?
Does app SAML SSO support IdP-initiated sign-in?
Does app SAML SSO support IdP-initiated sign-in?
Does Lovable support JIT user provisioning?
Does Lovable support JIT user provisioning?
Does Lovable support SCIM for app SAML SSO?
Does Lovable support SCIM for app 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?