SSO with Microsoft Entra ID

Entra ID (Azure AD) can send the sign-ins for a custom domain to a SAML 2.0 identity provider ("domain federation"). With Trowyn as that provider, users of the domain sign in to Microsoft 365 and every Entra-connected app by approving on their phone.

Advanced setup. Federation changes how everyone on the domain signs in. Try it on a spare domain first, never federate the onmicrosoft.com domain, and keep a cloud-only Global Administrator account (on onmicrosoft.com) so you can always undo it. Microsoft's reference: Use a SAML 2.0 identity provider for single sign-on.

What Entra requires

In the SAML response Must be
NameID (format persistent) The user's onPremisesImmutableId, up to 64 letters and digits
IDPEmail attribute The user's UserPrincipalName (UPN)
Issuer The Issuer URI you configure on the domain

1. Prepare users

2. Register Entra in Trowyn

In the console, SSO → Add app → SAML:

Field Value
Entity ID urn:federation:MicrosoftOnline
ACS URL https://login.microsoftonline.com/login.srf
NameID format persistent
Attribute mapping see below
{
  "nameid": "{user_local}",
  "authn_context": "http://schemas.microsoft.com/claims/multipleauthn",
  "attributes": {
    "IDPEmail": "{user}",
    "http://schemas.microsoft.com/claims/authnmethodsreferences": "http://schemas.microsoft.com/claims/multipleauthn"
  }
}

The multipleauthn values tell Entra that the user already completed multi-factor authentication, so Conditional Access doesn't ask again (with the setting in step 3).

3. Federate the domain

In PowerShell, with the Microsoft Graph module, signed in as a Global Administrator (Connect-MgGraph -Scopes "Domain.ReadWrite.All"):

$cert = "<the base64 text between the BEGIN/END lines of certificate.pem, on one line>"
New-MgDomainFederationConfiguration -DomainId "contoso.com" `
  -DisplayName "Trowyn" `
  -IssuerUri "https://trowyn.com/sso/<org id>/live" `
  -PassiveSignInUri "https://trowyn.com/sso/<org id>/live/saml" `
  -SignOutUri "https://trowyn.com/" `
  -PreferredAuthenticationProtocol "saml" `
  -FederatedIdpMfaBehavior "acceptIfMfaDoneByFederatedIdp" `
  -SigningCertificate $cert

Copy the issuer and SSO URL from the Trowyn console. To undo: Update-MgDomain -DomainId "contoso.com" -AuthenticationType "Managed".

Limits