Set up SAML with AD FS¶
This guide adds Tinfirm to Active Directory Federation Services as a relying party, so that your people sign in to Tinfirm with AD FS. Read Sign in with SAML first.
Before you start
- Your instance has an Enterprise licence.
- Whoever runs it chose the provider's id, such as
adfs. Settings, Sign-in shows its URLs once they added it; until then they give them to you. - AD FS reaches nothing of Tinfirm's: the person's browser carries every message. Tinfirm reads AD FS's metadata, so whoever runs it needs its URL, or the document as a file.
Checked against Microsoft's documentation; not yet checked against a live AD FS farm.
1. Add the relying party trust¶
- In AD FS Management, open Relying Party Trusts, Add Relying Party Trust, Claims aware.
- Choose Import data about the relying party published online or on a local network and enter Tinfirm's Service provider metadata URL,
https://tinfirm.example.com/saml2/service-provider-metadata/adfs. Or download the file and choose Import data about the relying party from a file. - Name it Tinfirm, choose who may sign in, and finish. The trust holds Tinfirm's entity ID, reply URL and certificates.
- Under Advanced, keep the secure hash algorithm SHA-256.
2. The claims¶
Add claim rules to the trust's Claim Issuance Policy:
-
Send LDAP Attributes as Claims, attribute store Active Directory:
LDAP attribute Outgoing claim type E-Mail-AddressesE-Mail AddressDisplay-NameNameobjectGUIDobjectGUID, a custom claim type, such ashttp://tinfirm.example.com/claims/objectguid -
Transform an Incoming Claim: the
objectGUIDclaim to Name ID, format Persistent Identifier. - Send Group Membership as a Claim for each Tinfirm role, such as the group
Tinfirm Adminsas the Role claim with valueTinfirm.Admin, and so on for members and viewers.
Ask whoever runs your instance to set nameAttributes to http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name, roleClaim to http://schemas.microsoft.com/ws/2008/06/identity/claims/role, roleMap to your values, and emailDomains to your domains.
3. Signing and encryption¶
AD FS signs the assertion by default. Run, in PowerShell:
AD FS encrypts the assertion with the certificate it imported from Tinfirm's metadata (recommended); Tinfirm decrypts it in the signed response. Ask whoever runs your instance to set requireEncryptedAssertions: true once it works.
4. The metadata and the link¶
Give whoever runs your instance AD FS's metadata URL, https://adfs.example.com/FederationMetadata/2007-06/FederationMetadata.xml, as the provider's metadataUrl. Publish Tinfirm's Sign-on URL, https://tinfirm.example.com/saml2/authenticate/adfs, as the link on your intranet instead of AD FS's idpinitiatedsignon page: sign-in always starts at Tinfirm.
5. Check it¶
Open the provider's Direct link and sign in. The audit log shows each sign-in as auth.login.succeeded with method: saml; a refused one as auth.login.failed with its reason (Troubleshooting).