Skip to main content
When a SAML connection has enforce login enabled, users whose email domain is covered by the connection must authenticate through SSO. Other login methods are refused — and the Web SDK gives you a typed signal so you can route those users into SAML without showing them an error.

The saml_login_required error

If your app starts an OTP login for an enforced email, the server responds with 403 saml_login_required. startOTP routes failures through the SDK’s error mapper, so it throws a typed SAMLLoginRequiredError, exported as PrldErrors.SAMLLoginRequired:

Fall back to SAML

On SAMLLoginRequiredError, restart the flow with loginWithSAMLByEmail. It resolves the connection from the same email domain and redirects the user to the Identity Provider:
The user authenticates with the IdP and is redirected back with a challenge_token, which you finalize exactly as in the SAML Login guide.
The fallback is transparent: the user enters their email expecting an OTP and is seamlessly redirected to their company’s SSO instead. No separate “Sign in with SSO” button is required.
This single email field starts an OTP login and silently upgrades to SAML when the domain enforces SSO.
src/App.jsx

What’s next?

Read the Enforce SSO login integration guide for the backend configuration, or the SAML Login guide for the standard flow.