Support

Configure Single Sign-on (SSO) with Microsoft AD FS

How to configure SAML authentication with Microsoft Active Directory Federation Service (AD FS).
Applies to:
Free
Basic
Business
Enterprise

ADMIN PRIVILEGES REQUIRED

Overview

This article is an overview of how to set up Stack Internal Community for single sign-on authentication with Microsoft Active Directory Federation Service (AD FS). This document covers AD FS 4.0 on Windows Server 2016. Previous versions will look and behave differently.

This article is not a comprehensive guide to AD FS, but rather a quick overview.

Create a Relying Party Trust

Manual setup

Before configuring Stack Internal Community, you must manually set up the relying party trust.

  1. In the AD FS folder tree, right-click on Relying Party Trusts. Click Add Relying Party Trust.

  2. Choose Enter data about the relying party manually.

  3. Enter a name of your choice.

  4. Optional: Specify a certificate to encrypt the SAML assertion. This is a public key for which the Stack Internal Community server has the private key.

  5. Check Enable support for the SAML 2.0 WebSSO protocol and enter the full SAML 2.0 post URL for your Stack Internal Community instance (https://[your_site].stackenterprise.co/auth/saml2/post) into the Relying party SAML 2.0 SSO service URL.

  6. Set an Identifier. You can make this anything you like. You'll enter this value as Issuer on your Stack Internal Community authentication settings page.

  7. Choose your desired Access Control Policy.

  8. To add an optional certificate, right-click on the new Relying Party Trust. Select Properties, then the Signature tab. Click Add to add a certificate. This allows Stack Internal Community to sign authentication requests and AD FS to validate the signature.

Additional configuration

Some settings for the Relying Party Trust cannot be configured through the GUI, but require PowerShell. Please refer to the Set-AD FSRelyingPartyTrust cmdlet for a full list of settings.

Here is an example Set-AD FSRelyingPartyTrust cmdlet command:

Set-AD FSRelyingPartyTrust -TargetName "Stack Internal Community" -SignedSamlRequestsRequired $true -SignatureAlgorithm "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" -SamlResponseSignature "MessageAndAssertion"

Some settings that you might want to check:

  • SignedSamlRequestsRequired Enforces the need for AuthnRequests to be signed.
  • SignatureAlgorithm Configures SHA-256 instead of the default SHA-1.
  • SamlResponseSignature Sets which part of the XML Response are signed.
  • SigningCertificateRevocationCheck Configures if and how the signing certificate is checked for validity (used when verifying signed AuthnRequests).
  • EncryptionCertificateRevocationCheck Configures if and how the encrypting certificate is checked for validity (used when encrypting the SAML Response).

Configure the claim issuance policy

You need to configure the claims that are being sent in the SAML response. Stack Internal Community requires a user identifier, display name, and email address.

Using rule language

The following command configures FS AD to send the displayName, mail, and objectSID attributes.

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", "http://schemas.microsoft.com/identity/claims/displayname", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "http://schemas.microsoft.com/identity/claims/objectidentifier"), query = ";objectSID,displayName,mail,objectSID;{0}", param = c.Value);

Manual setup

  1. Right-click your new Relying Party Trust and select Edit Claim Issuance Policy.

  2. Set Claim rule template to Send LDAP Attributes as Claims.

  3. Configure the required attributes. Note that Stack Internal Community does not currently use Name ID, but you should set it the same as User Identifier in case this changes in the future.

Troubleshooting AD FS

AD FS has an application-specific event log that is informative and helpful when troubleshooting problems. To access the AD FS log, open your local Event Viewer and expand the Applications and Services Logs folder. Expand the AD FS folder and click Admin.

SSO fails because of unsigned requests or a missing Name ID

When configuring AD FS for Stack Internal Community Basic or Business, you may encounter two separate configuration issues.

AD FS requires a signed authentication request

If AD FS displays the following error, its relying party trust requires a signature that the authentication request does not contain:

MSIS7085: The server requires a signed SAML authentication request but no signature is present.

Basic and Business send unsigned SAML authentication requests. On your AD FS server, open PowerShell with administrator privileges and run the following command. Replace Your relying party trust name with the display name of the trust you created for your Team:

Set-AdfsRelyingPartyTrust -TargetName "Your relying party trust name" -SignedSamlRequestsRequired $false

This changes the requirement for requests sent to AD FS. Keep the AD FS token-signing certificate and SAML response-signing configuration in place.

The SAML response is missing a Name ID

If authentication still fails, check the SAML debug output for a missing Subject/NameID or a message such as No SAML ID was given.

By default, Stack Internal Community uses the SAML response’s Name ID to identify the user. Sending an email address as an ordinary email claim does not also populate the Name ID.

To use the email address as the Name ID:

  1. In AD FS Management, right-click your Team’s relying party trust and select Edit Claim Issuance Policy.
  2. Confirm that the existing LDAP attribute rule sends E-Mail-Addresses as E-Mail Address.
  3. Add or edit a rule using Transform an Incoming Claim.
  4. Set Incoming claim type to E-Mail Address, Outgoing claim type to Name ID, and Outgoing name ID format to Email.
  5. Place this transformation after the rule that supplies the email claim, then save your changes.

The identifier must remain stable for each user across sign-ins.

Sign-in succeeds, but a Name ID format warning remains

If the debug output reports Unrecognized or missing NameID Format, the Name ID may be present but its format is missing or unrecognized. This warning alone does not mean authentication failed.

When the Name ID contains an email address, selecting Email as the outgoing format supplies:

urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress

Return to your Team’s Authentication settings, test the SAML configuration again, and confirm that sign-in succeeds. If AD FS instead returns a generic non-success status, review its event logs or contact Support; that error can have other causes.

For more information on troubleshooting, see the SAML Authentication Troubleshooting article.

https://doc-automation.netlify.app/pdfs/docs/community/enterprise/for_admins/single_sign-on_sso/configure_SAML_ADFS.pdf

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article