SAML SSO is set up per workspace (the connection, its verified email domains and whether SSO is enforced). A client workspace uses the connection of the nearest workspace above it that has one. These routes are what a sign-in page calls to send a person to their identity provider (IdP).
Find the SSO connection for an email#
/v1/auth/saml/discoverNoneHome-realm discovery: looks up the email's domain among verified SAML domains.
curl "https://api.scute.io/v1/auth/saml/discover?email=ada@acme.com"{ "workspace_id": "0193f8aa-0000-7000-8000-000000000000", "saml_login_url": "https://api.scute.io/v1/auth/app_xxx/saml/login", "enforce_sso": true}Send the browser to saml_login_url. When enforce_sso is true, every other way of signing in returns 403 sso_required for this domain.
A domain with no enabled connection returns 404 with {"error": "sso_not_available"}.
Start a SAML sign-in#
/v1/auth/:app_id/saml/loginNoneRedirects (302) to the IdP with a SAML AuthnRequest. Open it in the browser.
https://api.scute.io/v1/auth/app_xxx/saml/loginReturns 404 saml_not_configured when the app's workspace has no enabled connection.
After the IdP posts the assertion back, Scute redirects to the app's origin plus login URL with sct_oauth=<token>&sct_sk=true. Exchange the token with Authenticate a magic link to get the session.
URLs for the identity provider#
The IdP calls these. You enter them in the IdP's SAML app, or import the metadata.
| Endpoint | Use |
|---|---|
| GET /v1/auth/:workspace_id/saml/metadata.xml | Service provider metadata (entity ID, ACS URL, signing certificate). Returns 404 saml_not_configured until the connection is enabled. |
| POST /v1/auth/:workspace_id/saml/acs | Assertion consumer service. The IdP posts the SAML response here. |
| GET or POST /v1/auth/:workspace_id/saml/slo | Single logout. Takes the IdP's LogoutRequest, and the LogoutResponse of a logout Scute started. |
Signing out at the IdP ends the Scute session that the SAML sign-in created.
Rate limits#
The ACS, SLO and login routes allow 60 requests per minute per IP address. Over the limit they return 429.