Add SAML single sign-on to your app
You can let corporate customers sign in to your app using their work credentials through identity services like Okta or Microsoft. Setup requires exchanging a pair of connection web addresses between Lovable and your customer's login provider.
Anyone building B2B or internal software who needs to allow enterprise users to log in with their company accounts.
Do this, in order
- 1
Ask Lovable in project chat to 'Enable SAML SSO for this app' or navigate to More > Users > Settings > SAML SSO and turn it on.
This generates the two connection URLs your company identity provider needs to recognize your app.
- 2
Copy the ACS URL and Audience URI from the Advanced section in Lovable.
These tell the identity provider where to send users back once they have authenticated.
- 3
Create a SAML 2.0 application in your identity provider, paste in the ACS URL and Audience URI, map the email address field, and copy the provider's public metadata URL.
Your identity provider needs these settings to trust your app and share user login details securely.
- 4
Paste the metadata URL and your allowed company email domains back into the Lovable setup form and save.
This tells Lovable which email addresses should automatically be routed to that corporate login service.
- 5
Prompt Lovable to add a 'Sign in with SSO' button and email prompt to your sign-in page.
Configuring the backend does not automatically change your user interface, so your app needs buttons to launch the flow.
- 6
Open an incognito window and test logging in with a configured company email address.
Testing in a clean browser confirms the redirect to the company login screen and the return back into your app work properly.
Paste this into your project
Add a "Sign in with SSO" option to my sign-in page that prompts for an email and routes users to their SAML provider, and wire up the SSO redirect handling.
Words decoded
- SAML
- A standardized, secure format that companies use to log their workers into third-party software using existing work credentials.
- Identity Provider (IdP)
- The central service (like Okta or Microsoft Entra) where a company manages its staff accounts and passwords.
- Metadata URL
- A public web link provided by the company login system that shares its security certificates and connection settings with your app.
- ACS URL
- The specific web address on your app where the company login system sends the user after they successfully sign in.
Where people get stuck
- Users cannot sign in by clicking an app tile inside their company dashboard; sign-in must always start from your app's login page.
- You can only connect one corporate SAML identity provider per Lovable project.
- Setting up SAML for a domain does not automatically block standard password or Google sign-ins for that domain unless you turn those methods off manually.
- The metadata URL provided by the identity provider must be accessible over the public internet, not trapped behind a private internal network.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.