SAML 2.0
Connect the engine to AD FS, PingFederate, Entra ID, Okta or any SAML 2.0 identity provider.
On this page
Use SAML when your identity team standardizes on it, as many AD FS and PingFederate shops do. The engine is the service provider (SP); sign-in always starts at the engine.
What the engine requires
- A signed assertion, SHA-256 or stronger. Unsigned and SHA-1 signed assertions are refused, even inside a signed Response. Set
ENGINE_SAML_REQUIRE_SIGNED_RESPONSE=trueto also require the Response signature. - SP-initiated sign-in. The Response must answer the engine's AuthnRequest (
InResponseTo). IdP-initiated sign-in (from an app portal tile) is refused; point the tile at/api/auth/sso/saml/startinstead. - Destination and Audience set to the engine's ACS URL and entity ID, and a bearer
SubjectConfirmationDatawithInResponseTo(the engine's request) andRecipient(the ACS URL), as every SP-initiated IdP sends. - Unencrypted assertions over https. Encrypted assertions are not supported.
- One use. A replayed assertion is refused.
Steps
1. Get the engine's metadata
With ENGINE_PUBLIC_URL=https://engine.example.test, the SP metadata is at https://engine.example.test/api/auth/sso/saml/metadata. It holds:
| Field | Value |
|---|---|
| Entity ID | https://engine.example.test/api/auth/sso/saml/metadata |
| ACS URL | https://engine.example.test/api/auth/sso/saml/acs |
| Binding | HTTP-POST |
2. Create the relying party at the IdP
Import the metadata, or enter the entity ID and ACS URL by hand. Send:
- the NameID as the email address (or a persistent id, plus an
emailattribute); - the groups as an attribute. Without
ENGINE_SAML_GROUPS_ATTRIBUTEthe engine reads the first ofgroups, the Microsoft groups claim, the AD FSclaims/Groupclaim,memberOfandgroupthat is present; it never merges them and never reads a role claim as groups. To map Entra app roles instead, setENGINE_SAML_GROUPS_ATTRIBUTEto the role claim.
On AD FS, add a claim rule Send LDAP Attributes as Claims: E-Mail-Addresses to Name ID and E-Mail Address, and Token-Groups - Unqualified Names to Group.
3. Configure the engine
ENGINE_SAML_IDP_ENTITY_ID=http://adfs.example.test/adfs/services/trust
ENGINE_SAML_IDP_SSO_URL=https://adfs.example.test/adfs/ls/
ENGINE_SAML_IDP_CERT="-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----"
ENGINE_SAML_LABEL="Active Directory"
ENGINE_SAML_GROUP_ROLES="MedHook Admins=admin;MedHook Operators=operator"ENGINE_SAML_IDP_CERT is the IdP's token-signing certificate, PEM or base64. Put two during a certificate rollover; both are accepted until you remove the old one.
4. MFA
The engine treats these authentication contexts as multi-factor: Entra's multipleauthn, AD FS's phone factor, SAML's mobile two-factor classes and the REFEDS MFA profile. A smart card or token class alone does not count. Set ENGINE_SAML_REQUIRE_MFA=true to refuse anything else.
5. Test
Sign in from /sign-in with Continue with Active Directory. A refused Response is in the audit log as auth.signin_failed with the reason, such as invalid_signature, audience, destination, expired, in_response_to or replay.