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.comdomain, and keep a cloud-only Global Administrator account (ononmicrosoft.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
- Link each user's phone in Trowyn with their UPN (for example
alice@contoso.com) as theexternal_user_id. - Give every user an
onPremisesImmutableIdthat Trowyn can send. For cloud-only users, the simplest choice is the part of the UPN before@if it is letters and digits only and unique, set with Microsoft Graph PowerShell before federating:Update-MgUser -UserId alice@contoso.com -OnPremisesImmutableId "alice". Users synced from Active Directory already have one; link them with that value as the label and map NameID to{label}instead.
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
- Trowyn supports the browser (passive) sign-in only. Old clients that use active endpoints (WS-Trust/ECP, for example legacy Exchange ActiveSync) won't work through federation; use modern authentication.
- Entra's newer external authentication methods (a third-party MFA inside Entra's own sign-in) aren't supported yet.
- When you rotate the Trowyn SAML certificate, update the domain's signing certificate
(
Update-MgDomainFederationConfiguration … -NextSigningCertificate) before making the new one active.