docs/main/administration-guide/onboard/sso-saml-adfs-msws2016.mdx
import Inc0_sso_saml_before_you_begin from './sso-saml-before-you-begin.mdx'; import Inc1_sso_saml_faq from './sso-saml-faq.mdx'; import Inc2_sso_saml_ldapsync from './sso-saml-ldapsync.mdx';
<PlanAvailability slug="all-commercial" />This document provides steps to configure SAML 2.0 with Microsoft ADFS for Mattermost and Microsoft Windows Server 2016.
<Inc0_sso_saml_before_you_begin />
On your ADFS installation, open the ADFS console. Select Service, then select Endpoints. In the Type column, search for SAML 2.0/WS-Federation and note down the value of URL Path column. This is also known as the SAML SSO URL Endpoint in this guide. If you chose the defaults for the installation, this will be /adfs/ls.
Open the ADFS management snap-in, then select AD FS > Relying Party Trusts > Add Relying Party Trust from the right sidebar. You can also right-click Relying Party Trusts, then select Add Relying Party Trust from the context menu.
On the Welcome screen of the configuration wizard, select Claims aware, then select Start.
On the Select Data Source screen, select Enter data about the relying party manually.
On the Specify Display Name screen, enter a Display Name (e.g., Mattermost). You can add optional notes.
On the Configure Certificate screen, leave the certificate settings at their default values.
If you would like to set up encryption for your SAML connection, select Browse, then upload your Service Provider Public Certificate.
On the Configure URL screen, select Enable Support for the SAML 2.0 WebSSO protocol, then enter the SAML 2.0 SSO service URL in the following format:https://<your-mattermost-url>/login/sso/saml where <your-mattermost-url> should typically match the Mattermost Site URL.
On the Configure Identifiers screen, enter the Relying party trust identifier. This identifies the claims being requested. The SAML 2.0 SSO service URL format should be https://<your-mattermost-url>/login/sso/saml where <your-mattermost-url> matches your Mattermost Site URL. Then choose Next.
This string must match the Service Provider Identifier string. For more information about the Relying party trust identifier and how prefix matching is applied see this documentation.
Add your SAML 2.0 SSO service URL using this same process.
On the Choose Access Control Policy screen, select the access control policy suitable for your environment. This guide assumes the default values Permit everyone and an unchecked box.
On the Ready to Add Trust screen, review your settings.
On the Finish screen, select Configure claims issuance policy for this application, then select Close.
In the Issuance Transform Rules tab of the Claim Rules editor, select Add Rule….
On the Choose Rule Type screen, select Send LDAP Attributes as Claims from the drop-down menu, then select Next.
On the Configure Claim Rule screen, enter a Claim Rule Name of your choice, select Active Directory as the Attribute Store, then add the following mapping:
- From the LDAP Attribute column, select
E-Mail-Addresses. From the Outgoing Claim Type, type- From the LDAP Attribute column, select
E-Mail-Addresses. From the Outgoing Claim Type, typeName ID.- From the LDAP Attribute column, select
Given-Name. From the Outgoing Claim Type, typeFirstName.- From the LDAP Attribute column, select
Surname. From the Outgoing Claim Type, typeLastName.- From the LDAP Attribute column, select
SAM-Account-Name. From the Outgoing Claim Type, typeUsername.
The FirstName and LastName attributes are optional.
Select Finish to add the rule.
The entries in the Outgoing Claim Type column can be modified. The entries may contain dashes but no spaces. They are used to map the corresponding fields in Mattermost.
Select Add Rule to create another new rule.
On the Choose Rule Type screen, select Transform an Incoming Claim from the drop-down menu, then select Next.
On the Configure Claim Rule screen, enter a Claim Rule Name of your choice, then:
- Select Name ID for the Incoming claim type
- Select Unspecified for the Incoming name ID format
- Select E-Mail Address for the Outgoing claim type
Select Pass through all claim values, then select Finish.
Set-ADFSRelyingPartyTrust -TargetName <display-name> -SamlResponseSignature "MessageAndAssertion"
where <display-name>is the name you specified in step 4 when you added a relying party trust. In this example, <display-name> would be mattermost.
This action adds the signature to SAML messages, making verification successful.
Next, export the identity provider certificate, which will be later uploaded to Mattermost to finish SAML configuration.
Open the ADFS management snap-in, select AD FS > Service > Certificates, then double-click on the certificate under Token-signing. You can also right-click the field, then select View Certificate in the context menu.
On the Certificate screen, open the Details tab, select Copy to File, then select OK.
On the Certificate Export Wizard screen, select Next.
Select Base-64 encoded X.509 (.CER), then select Next again.
On the Certificate Export Wizard screen, select Browse to specify the location where you want the Identity Provider Certificate to be exported, then specify the file name.
Select Save. On the Certificate Export Wizard screen, verify the file path is correct, then select Next.
In the Completing the Certificate Export Wizard, select Finish, then select OK to confirm the export was successful.
Create a metadata URL by appending "FederationMetadata/2007-06/FederationMetadata.xml" to the root URL of the ADFS server, for example: https://<adfs.domain.com>/federationmetadata/2007-06/FederationMetadata.xml>.
Next, start the Mattermost server, then log in to Mattermost as a system admin. Go to System Console > Authentication > SAML, paste the metadata URL in the Identity Provider Metadata URL field, then select Get SAML Metadata from IdP.
This populates the SAML SSO URL and the Identity Provider Issuer URL fields automatically. The Identity Provider Public Certificate is also downloaded from the server and set locally.
The following fields can be selected:
If you don't plan to use a metadata URL, you can manually enter the following fields:
For SAML SSO URL use the SAML 2.0/W-Federation URL ADFS Endpoint you copied at the beginning of the process.
For Identity Provider Issuer URL use the Relying party trust identifier from ADFS.
For Identity Provider Public Certificate use theX.509 Public Certificate.
Set Verify Signature to
true.For Service Provider Login URL use the
SAML 2.0 SSO service URLyou specified in ADFS.
Set Enable Encryption to
true.For Service Provider Private Key use the Service Provider Private Key generated at the start of this process.
For Service Provider Public Certificate use the Service Provider Public Certificate you generated at the start of this process.
Set Sign Request to suit your environment.
For Mattermost servers running 3.3 and earlier, the first name and last name attributes are also required fields.
First Name Attribute and the Last Name Attribute, go to System Console > Site Configuration > Users and Teams, then set Teammate Name Display to Show first and last name. This is recommended for a better user experience.You’re done! If you’d like to confirm SAML SSO is successfully enabled, switch your system admin account from email to SAML-based authentication from your profile picture via Profile > Security > Sign-in Method > Switch to SAML SSO, then log in with your SAML credentials to complete the switch.
We also recommend that you post an announcement about how the migration will work to your users.
You may also configure SAML for ADFS by editing the config.json file to enable SAML based on SAML configuration settings. You must restart the Mattermost server for the changes to take effect.
<Inc1_sso_saml_faq />
<Inc2_sso_saml_ldapsync /> :start-after: :nosearch: