Skip to content
LogoLogo

SSO provider setup: Okta, Google, Microsoft Entra ID

How to configure each identity provider for a SaaSLayer SSO connection (combinations A and B; for C see Combo C). Read Enterprise SSO first.

The console steps for each provider are in its IT admin quickstart, the page the company's IT admin follows from a setup link. This page is the operator's side: the sso add command, what each provider sends and how it behaves. For the whole operator flow in one pass, see Your first SSO connection; when a sign-in is refused, see SSO troubleshooting.

RecipeIT admin quickstartStatus
Okta OIDC (custom authorization server, groups scope and groups claim)Okta OIDCSupported: tested end to end with Okta: sign-in with groups, 5-minute tokens, both refresh methods, the identity join with SCIM externalId. The dashboard tile mechanism is tested
Okta SAML (NameID = Okta user id, public metadata URL)Okta SAMLSupported: tested end to end with Okta: sign-in with the immutable NameID and the groups attribute, hosted refresh; an email NameID refused (email-shaped-subject). The SAML tile is in preview
Microsoft Entra ID OIDC (subject oid)Entra OIDCSupported: tested end to end with Microsoft Entra ID: subject oid, groups as object ids; an onmicrosoft.com email refused (domain-mismatch)
Microsoft Entra ID SAML (NameID = object id)Entra SAMLSupported: tested end to end with Microsoft Entra ID: NameID = object id, groups from Entra's default group claim
Google OIDCGoogleSupported: tested end to end with Google Workspace: domain sign-in in a browser, sso_groups complete and empty, both refresh methods
SCIM from Okta or Entra—Supported (preview): tested end to end with the Microsoft Entra ID and Okta provisioning clients (create, identity join, group push, sync-complete, deprovision)

"Tested end to end" means the provider setup worked against a real provider tenant and a real deployment (Cognito Lite). Every tested sign-in carried sso_connection, sso_tenant, sso_groups (a JSON string), sso_groups_truncated, custom:suid and custom:soid in the ID token (on Lite, the ID token only), lived 299 seconds and refreshed through the hosted refresh. Names are provisional until the SSO naming review.

The common flow

  1. Create the connection as a draft. The tenant is the org the company's people belong to. The issuer and the provider's values (SAML metadata, OIDC client id and secret) are optional at this point: a draft created with only --tenant and --protocol starts blank, and its IT admin enters them through a setup link (step 3). Activation is refused (SSO_CONNECTION_INCOMPLETE) until they are set; the connection lists what is missing in missingIdpFields.

  2. Read what to register in the identity provider:

    saaslayer sso status <connectionId>

    It shows the SP values (also at GET /api/sso/connections/{connectionId}/service-provider), on the deployment's branded login host, auth.<space>.saaslayer-cloud.com (managed) or your own such as auth.yourapp.com:

    • OIDC: the redirect URI https://auth.yourapp.saaslayer-cloud.com/oauth2/idpresponse.
    • SAML: the SP entity id urn:amazon:cognito:sp:<userPoolId> and the ACS URL https://auth.yourapp.saaslayer-cloud.com/saml2/idpresponse.

    Set and activate the branded login domain before you hand out these values. Until you do, the login host is the …amazoncognito.com domain, and people see it in the address bar while the browser passes through to their identity provider (Cognito shows no screen of its own: sign-in passes the connection as identity_provider):

    saaslayer users login-domain provision managed --env prod --reason "branded login host"
    saaslayer users login-domain status --env prod
    saaslayer users login-domain activate --confirm-domain <current-login-host> --reason "branded login host" --env prod

    provision takes managed or your own host (auth.yourapp.com, which needs two DNS records; status shows them). Switching hosts later moves the redirect and ACS URLs of every connection (the entity id stays). activate prints a checklist naming the URLs each connection's identity provider must register on the new host: add them beside the old ones before the switch, and remove the old ones only once sign-in works on the new host.

  3. Configure the identity provider (its IT admin quickstart, linked above), or send the company's IT admin a setup link that writes the link to SSM or a file, never to the terminal:

    saaslayer sso link issue <connectionId> --to-ssm /acme/sso-setup-link
  4. Add and verify the company's domains. add prints the DNS TXT record the company publishes:

    saaslayer sso domains add <connectionId> acme.com
    saaslayer sso domains verify <connectionId> acme.com
  5. Activate. Activation applies the provider and the connection's own app client in Cognito, then trusts the connection:

    saaslayer sso activate <connectionId>

The identity namespace (issuer, providerTenant, subjectSource, the OIDC client id) locks at the first activation. Get the subject right before you activate.

Setup gotchas

  • The verified domain must match the people's email domain. A sign-in whose email is outside the connection's verified domains is refused with domain-mismatch. Entra users often have only an onmicrosoft.com address: add and verify a custom domain in Entra (and give the users addresses in it) before they can sign in through the connection. Contractors outside the verified domains are invited by email and use native sign-in.
  • A domain belongs to one connection. Verifying a domain another connection owns is refused (SSO_DOMAIN_CLAIMED). To move it: saaslayer sso domains remove on the old connection, then add and verify it on the new one (tested end to end).
  • Okta's authorization server rejects a scope it doesn't have. Requesting groups from an Okta authorization server fails with invalid_scope unless a scope named groups exists on that server.
  • The subject is never an email. An email-shaped SAML NameID is refused with email-shaped-subject. Set it to the provider's immutable id before anyone signs in.

Your app's name and logo at the identity provider

The identity provider's own pages (its sign-in, consent screen and app dashboard) show the name and logo set on the app the IT admin creates. Set them to the app's name and logo, so the whole sign-in reads as your app: the IT admin quickstarts say where, under Show the app's name and logo.

  • Google: the OAuth consent screen's App name, App logo, Application home page and Authorized domains. With Audience Internal, no Google verification is needed; an External app that shows a logo needs Google's brand verification first. Steps: Google.
  • Okta: the app's name and logo on its General tab, shown on the Okta End-User Dashboard. Steps: Okta OIDC, Okta SAML.
  • Entra: the enterprise application's Name and Logo (and, for OIDC, the app registration's Branding & properties), shown on Entra's sign-in and consent pages and in My Apps. Steps: Entra OIDC, Entra SAML.

The pages SaaSLayer serves (the hosted SSO settings and setup pages, and the sign-in widgets) take the deployment's brand: the company name, product name, logo and accent color set for its emails.

Okta OIDC

Status: Supported. Tested end to end with Okta (Cognito Lite). IT admin steps: Okta OIDC quickstart.

Use a custom authorization server with a groups scope and a groups claim on the ID token. The issuer is the server's (https://<okta domain>/oauth2/<server id>), never the bare Okta domain: Okta's org authorization server sends no groups claim. The subject is OIDC sub, which on a custom server is the immutable Okta user id (00u…). The client secret is read from stdin only. Request groups beside the defaults (--oidc-scope repeats):

saaslayer sso create --tenant <orgId> --protocol oidc --issuer https://acme.okta.com/oauth2/default \
  --client-id <okta-client-id> --client-secret-stdin --domain acme.com --subject-source sub \
  --oidc-scope openid --oidc-scope email --oidc-scope profile --oidc-scope groups < okta-client-secret.txt
  • The Okta MFA policy stays in force. A password-only access policy only suits headless tests. A real tenant keeps its own sign-on and MFA policies, which --mfa delegated relies on.
  • Groups come from this claim until you confirm SCIM: each sign-in's ID token replaces the person's groups, ordered by its iat (see Groups). A removal applies at the next sign-in; use SCIM for removals that apply at once. Once mapped to the Okta user id (see SCIM), Okta's SCIM externalId is the same id as sub, so SCIM and sign-in join to one identity.
  • Dashboard tile: see SSO dashboard tiles.

Okta SAML

Status: Supported. Tested end to end with Okta: sign-in, the groups attribute and refresh. The SAML tile is in preview. IT admin steps: Okta SAML quickstart.

The NameID must be the immutable Okta user id: Application username Custom user.getInternalProperty("id"), Name ID format Persistent. Okta's default NameID is the email, which SaaSLayer refuses (email-shaped-subject). Okta applies a changed username template only to new assignments, so re-apply the app's assignments after changing it. Name the email attribute email.

Use the app's public metadata URL, https://<okta domain>/app/<app key>/sso/saml/metadata. The Okta Admin API metadata link (/api/v1/apps/…/metadata) needs an API token, so Cognito can't fetch it. The connection's issuer is the IdP entity id from that metadata (http://www.okta.com/<app key>):

saaslayer sso create --tenant <orgId> --protocol saml --issuer http://www.okta.com/exk123abc \
  --metadata-url https://acme.okta.com/app/exk123abc/sso/saml/metadata --domain acme.com --subject-source nameid
  • Groups come from the groups attribute until you confirm SCIM. The SAML assertion reaching SaaSLayer has no issue time, so sign-ins are ordered by arrival: a delayed older sign-in can briefly replace a newer list. Use SCIM where that matters.
  • Certificate rotation: saaslayer sso rotate-secret <connectionId> --metadata-url … (or --metadata-file) replaces the metadata in place. Two signing certificates may overlap during a rotation. Metadata whose every signing certificate has expired is refused. Expiry alerts arrive at 90, 30, 7 and 1 days.
  • Dashboard tile: hide the SAML app's own tile and use a Bookmark app; see SSO dashboard tiles (preview).

Google OIDC

Status: Supported. Tested end to end with Google Workspace (a browser sign-in). No groups, no directory sync. IT admin steps: Google quickstart.

saaslayer sso create --tenant <orgId> --protocol oidc --issuer https://accounts.google.com \
  --client-id <google-client-id> --client-secret-stdin --domain acme.com --subject-source sub < google-client-secret.txt
  • The hd claim decides membership in the company. A Google sign-in is accepted only when its email and Google's signed hd claim are in the connection's verified domains. A personal Gmail account or another Workspace is refused.
  • No groups. Google sends no groups, and Google directory sync is not supported in this release (follow-up). The token's sso_groups is "[]" with sso_groups_truncated "false": complete and empty. A Google connection grants no group-derived roles. Give its people access by other means: manual grants (A) or your own logic (B).
  • The subject. Google's sub is numeric and immutable.
  • Headless tests don't work. Google needs a real browser sign-in.

Microsoft Entra ID OIDC

Status: Supported. Tested end to end with Microsoft Entra ID: subject oid, groups as object ids. IT admin steps: Entra OIDC quickstart. The users' email domain must be a verified custom domain in Entra and on the connection (see Setup gotchas).

Use the tenant-specific v2.0 issuer https://login.microsoftonline.com/<tenant id>/v2.0, pin the tenant, and take the subject from oid. Entra's sub is per application, while oid is the immutable object id:

saaslayer sso create --tenant <orgId> --protocol oidc --issuer https://login.microsoftonline.com/<tenant-id>/v2.0 \
  --client-id <application-id> --client-secret-stdin --provider-tenant <tenant-id> --subject-source oid \
  --domain acme.com < entra-client-secret.txt
  • Groups come from the app's groups claim, as Entra object ids. More groups than fit in the token (overage) count as incomplete, never as a complete list.
  • Admin consent. Grant admin consent for the tenant on the app registration, or people get consent_required (AADSTS65004 when they decline).
  • Client secret expiry. Entra secrets expire; rotate with saaslayer sso rotate-secret <connectionId> --client-secret-stdin before then.

Microsoft Entra ID SAML

Status: Supported. Tested end to end with Microsoft Entra ID: NameID = object id, groups from Entra's default group claim. IT admin steps: Entra SAML quickstart. The users' email domain must be a verified custom domain in Entra and on the connection.

  • Name ID: Persistent, source user.objectid, never the UPN or email.
  • Claims: an email claim (Entra's default emailaddress claim works).
  • Groups: SaaSLayer reads a groups attribute when one is sent, else Entra's default http://schemas.microsoft.com/ws/2008/06/identity/claims/groups (group object ids). When a user is in too many groups, Entra sends http://schemas.microsoft.com/claims/groups.link instead; that counts as overage (incomplete), never as a partial list.
  • The issuer is the Microsoft Entra Identifier, https://sts.windows.net/<tenant id>/. Pin the tenant with --provider-tenant, in lower case as Entra sends it.
saaslayer sso create --tenant <orgId> --protocol saml --issuer https://sts.windows.net/<tenant-id>/ \
  --metadata-url <app-federation-metadata-url> --provider-tenant <tenant-id> --subject-source nameid --domain acme.com

SCIM

SCIM takes over group authority from sign-in once you confirm its first push, and it is the source of immediate deprovisioning. Status: Supported (preview). Tested end to end with the Microsoft Entra ID and Okta provisioning clients: user create, the identity join with sign-in, group push, sync-complete, and deprovisioning, after which the person is signed out and loses org access. The semantics are also tested with direct requests: authentication, server-assigned ids, filters, 409 on conflict, externalId required, PATCH active:false and groups.

  1. Turn SCIM on and take a bearer token. Like a setup link, it goes to SSM or a new 0600 file, never the terminal:

    saaslayer sso update <connectionId> --scim on
    saaslayer sso scim issue <connectionId> --to-ssm /acme/scim-token

    The SCIM base URL is <user-service API base>/scim/v2/<connectionId> (shown by saaslayer sso scim status).

  2. In the identity provider, enter that URL and the token, and map externalId to the immutable user id:

    • Okta: the Okta user id. Okta does not send externalId by default, and externalId is a reserved variable name there. In the app's profile (Directory → Profile Editor), add an attribute with variable name saaslayerExternalId, external name externalId and external namespace urn:ietf:params:scim:schemas:core:2.0:User, then map user.getInternalProperty("id") to it (Okta User to app, on create and update). Without it every create is refused with externalId is required. Any password Okta sends is ignored and never stored, so Sync Password can stay as it is. People assigned before provisioning was enabled are not pushed: re-assign them. Steps: the Okta OIDC and Okta SAML quickstarts.
    • Entra: objectId. Entra's default maps mailNickname, which is wrong here: change it before the first push.

    Push users first, then groups.

  3. When the first full push is done, confirm it, so SCIM becomes the group authority:

    saaslayer sso scim sync-complete <connectionId>
  • Token rotation. saaslayer sso scim rotate <connectionId> <credentialId> --to-ssm … keeps the old token working for an overlap (default 1 day). A connection holds at most 2 active tokens.
  • What SCIM refuses. Nested groups are refused, and a create without externalId. A member must be a SCIM user id of the same connection (never an email or user name). A password is ignored, never stored: people sign in through the identity provider. The connection's SSO audit records an ignored password as ignored: ["password"] on the scim.request event, and a refused request with its SCIM scimType and detail.
  • Re-provisioning. After a DELETE, re-provisioning the same externalId gives a new SCIM id and restores no group memberships: the provider pushes them again.