mirror of
https://github.com/hanzoai/team.git
synced 2026-11-01 07:55:31 +00:00
* docs: resolve cross-file anchor mismatches from RST-to-MDX migration
The Sphinx-to-Docusaurus migration converted `:ref:`/`{ref}` links using
naive text-slugification, so anchors that pointed to headings in a
different file (e.g. release-summary tables linking into their
respective changelog pages) were emitted as same-page fragments and
silently resolved to nothing.
Built a label registry from the original Sphinx `.. _label:` / `(label)=`
targets to recover the true source file for each cross-reference, then
rewrote the affected links to point at the correct file + heading
anchor. Fixes 282 broken cross-file anchors, primarily in the mobile/
desktop/server release-summary pages, plus assorted same-page anchor
mismatches caught by re-auditing after the prior admonition/anchor fix.
* docs: manually resolve remaining anchor mismatches after cross-file audit
Hand-verified fixes for anchors that fuzzy-matching alone couldn't
safely resolve (confirmed against actual heading text/context, and in a
few cases against the original RST source, before applying):
- Typos and dropped words carried over from the original Sphinx docs
(e.g. "bot-acocunts", "auto-follow-all-new-channel-threads" ->
"follow-all-new-channel-threads").
- Sphinx auto-generated duplicate-heading IDs (#id1/#id3/#id4) resolved
to their real target headings.
- Numbered-step TOC links in enterprise-roll-out-checklist.mdx that
dropped the leading "N. " used in the actual heading slugs.
- Push-notification docs pointing at the wrong file entirely
(environment-configuration-settings instead of
push-notification-server-configuration-settings).
- SAML "saml-enterprise" label resolved to its true cross-file target
(authentication-configuration-settings#saml-2-0), recovered from the
original RST label definition that the automated registry missed
because it sat after an RST transition marker.
- sso-saml-technical references converted from broken same-page/
malformed-path anchors to correct page links.
* docs: fix SAML 2.0 anchor slug (saml-2-0 -> saml-20)
github-slugger strips periods rather than hyphenating them, so "SAML
2.0" slugifies to saml-20, not saml-2-0 as previously fixed.
* docs: fix broken path links found during docs/main migration cleanup
* docs: convert div.tab blocks to Docusaurus Tabs/TabItem components
* docs: restore missing Kubernetes deployment architecture diagrams
The RST-to-MDX migration never copied over the AWS/Azure/Oracle
architecture diagrams referenced by the deployment-architecture-at-scale
page, leaving broken images in each Tabs/TabItem.
* docs: fix 7 anchor mismatches from the fragment/heading audit
Covers three root causes from the anchor mismatch breakdown:
- Fragment repeated the target page's own title instead of a real
heading, so the link is simplified to point at the bare page.
- Heading exists verbatim but lives on a sibling settings page
(experimental-configuration-settings, push-notification-server-
configuration-settings) rather than environment-configuration-settings.
- A page path was mistakenly pasted into a same-page #fragment instead
of being used as a real cross-page link.
* docs: fix 8 anchor slugs that were close but didn't match the real heading
Repoints links whose fragment was a plausible guess (typo, reworded
heading, or wrong section) at the actual auto-generated slug of the
target heading, confirmed by inspecting each target page directly.
* docs: merge split Tabs blocks so tabs render horizontally
The div.tab conversion script split some sibling tab groups into
separate single-item Tabs blocks whenever a stray blockquote marker
sat between them, causing them to render stacked instead of as one
horizontal tab bar. Merges the MySQL/PostgreSQL and Team/Enterprise
Edition tab groups back into single Tabs blocks.
* docs: remove Azure tab and restore Kubernetes deploy content
The Mattermost Operator, Azure, and Oracle platform tabs on the
Kubernetes deployment guide were split across two separate Tabs
blocks (rendering stacked instead of as one tab bar) and all three
tab bodies were empty because the migration never flattened the
original RST include directives. Removes the unsupported Azure tab
and restores the Mattermost Operator and Oracle content from the
pre-migration RST sources as a single merged Tabs block.
* addresscoderabbitreview
* docs: unify Linux/Kubernetes/Containers deploy pages and fix FIPS/STIG placement
Kubernetes and Containers duplicated full install content across a top-level
page (Tabs) and orphaned sidebar subpages that nothing linked to. Reworked
both to follow the Linux page's pattern: shared content on the landing page,
platform-specific instructions live once in their own subpage.
Also removed configure-fips-at-install-time.mdx, which claimed FIPS is
available for native Linux installs — FIPS/STIG in Mattermost is a container
image property (Chainguard-based build), not available outside Docker/
Kubernetes. Consolidated all FIPS/STIG references onto
containers/fips-stig.mdx and pointed the Mattermost Operator subpage (not
Oracle OKE, which doesn't expose image selection) at it.
* docs: fix review findings — image alt text, Important callout markup, typo
- Replace generic alt="image" on scaling diagrams with descriptive text
identifying cloud provider and user scale.
- Convert raw div.important markup in deploy-containers.mdx to the
repo's <Important> component, matching usage elsewhere in the file.
- Fix "Matermost" typo in manage-your-display-options.mdx.
---------
Co-authored-by: Hanzo Dev <[email protected]>
245 lines
11 KiB
Plaintext
245 lines
11 KiB
Plaintext
---
|
|
title: "Configure SAML with Keycloak"
|
|
---
|
|
import Inc0_sso_saml_ldapsync from './sso-saml-ldapsync.mdx';
|
|
import Inc1_sso_saml_faq from './sso-saml-faq.mdx';
|
|
|
|
<PlanAvailability slug="all-commercial" />
|
|
|
|
The following process provides steps to configure SAML with Keycloak for Mattermost.
|
|
|
|
See the encryption options documentation for details on what [encryption methods](/deployment-guide/encryption-options#saml-encryption-support) Mattermost supports for SAML.
|
|
|
|
## Set up Keycloak for Mattermost SSO
|
|
|
|
<Note>
|
|
|
|
This was tested with Keycloak v26.4.0. We recommend adding Mattermost as a client to your primary realm.
|
|
|
|
</Note>
|
|
|
|
1. Log in to Keycloak as an administrator.
|
|
2. Select **Clients**, then **Create client**. You'll use this client ID in a later step.
|
|
|
|
> - **Client type**: `SAML`
|
|
> - **Client ID**: `mattermost`
|
|
|
|
3. Click **Next** and update the following values:
|
|
|
|
> - **Root URL**: `http://your-mattermost-url.com`
|
|
> - **Home URL**: `/login/sso/saml`
|
|
> - **Valid redirect URIs**: `/login/sso/saml`
|
|
|
|
4. **Save** the client.
|
|
5. Under the **Settings** tab, update the following values:
|
|
|
|
> - **Enabled**: **On**
|
|
> - **Name ID format**: `email`
|
|
> - **Force Name ID format**: **On**
|
|
>
|
|
> 
|
|
>
|
|
> 
|
|
|
|
6. Under the **Signature and Encryption** section, update the following values:
|
|
|
|
> - **Sign Documents**: **Off**
|
|
> - **Sign Assertions**: **On**
|
|
> - **Signature Algorithm**: `RSA_SHA1`
|
|
> - **SAML signature key name**: `NONE`
|
|
> - **Canonicalization Method**: `EXCLUSIVE`
|
|
> - **Encryption Algorithm**: `AES_256_GCM`
|
|
> - **Key Transport Algorithm**: `RSA_OAEP_MGF1P`
|
|
> - **Digest method for RSA-OAEP**: `SHA1`
|
|
>
|
|
> 
|
|
>
|
|
> <div class="warning">
|
|
>
|
|
> <div class="title">
|
|
>
|
|
> Warning
|
|
>
|
|
> </div>
|
|
>
|
|
> Mattermost only supports `RSA_SHA1` for Keycloak SAML, because Keycloak is using `xmlenc` for `RSA_SHA512` and `RSA_SHA256`, wheras Mattermost currently only supports `xmldsig`. So make sure to use `RSA_SHA1` as the *Signature Algorithm* and *Digest Method* as described in this section.
|
|
>
|
|
> </div>
|
|
|
|
7. Navigate to the **Keys** tab.
|
|
|
|
> - **Client signature required**: **Off**
|
|
>
|
|
> - **Encrypt Assertions**: **On**
|
|
>
|
|
> 1. Click **Generate**
|
|
> 2. Download the **private.key** file.
|
|
> 3. Click **Confirm**
|
|
>
|
|
> 
|
|
>
|
|
> <div class="warning">
|
|
>
|
|
> <div class="title">
|
|
>
|
|
> Warning
|
|
>
|
|
> </div>
|
|
>
|
|
> Mattermost does not support request signing with Keycloak so make sure to disable the Client signature setting as mentioned above.
|
|
>
|
|
> </div>
|
|
>
|
|
> Next, click **Export** and update the following values and download the keystore.p12 file.
|
|
>
|
|
> - **Archive Format**: `PKCS12`
|
|
> - **Key Alias**: `mattermost`
|
|
> - **Key Password**: `mattermost`
|
|
> - **Store Password**: `mattermost`
|
|
>
|
|
> 
|
|
|
|
8. Navigate to the **Client scopes** tab.
|
|
|
|
First we add the predefined mappers for email, first name, and last name.
|
|
|
|
1. Select **mattermost-dedicated**
|
|
2. Click **Add predefined mapper**
|
|
3. Select the **X500 email**, **X500 givenName**, and **X500 surname** attributes.
|
|
4. Click **Add**.
|
|
|
|
Next, we add the mappers for username and id.
|
|
|
|
1. Select **Add Mapper** -\> **By Configuration** -\> User Property.
|
|
2. Set **Name** to `Username`.
|
|
3. Set **Property** to `username` (This is case sensitive and must be lowercase).
|
|
4. Set **SAML Attribute Name** to `username`.
|
|
5. Select **Save**.
|
|
|
|

|
|
|
|
6. Repeat the above steps and use the custom property of `id` to create the ID Attribute.
|
|
|
|

|
|
|
|
<Note>
|
|
|
|
If you're planning to sync your SAML users with LDAP within Mattermost, the ID value used here must match with your Mattermost LDAP `ID Attribute`.
|
|
|
|
</Note>
|
|
|
|
Once done your Mappers should look like this:
|
|
|
|

|
|
|
|
9. Get the metadata URL from Keycloak:
|
|
|
|
1. Within your Realm, select **Realm Settings**.
|
|
2. At the bottom of the **General** tab you should see a **SAML 2.0 Identity Provider Metadata** endpoint. Right-click and copy this URL. Store for the next step.
|
|
|
|

|
|
|
|
## Configure SAML in Mattermost
|
|
|
|
1. In the Mattermost **System Console** go to **Authentication \> SAML**.
|
|
|
|
2. Set the **Identity Provider Metadata URL** to the value you copied from the step above and select **Get SAML Metadata from IdP**. The metadata import will populate fields related to your Keycloak configuration.
|
|
|
|
If you have any issues with this import, you can check the `mattermost.log` file for more information. [Enable debug logging](/administration-guide/manage/logging#how-do-i-enable-debug-logging) and try again.
|
|
|
|
> 
|
|
|
|
<Note>
|
|
|
|
- If Mattermost does not correctly pull the **Identity Provider Public Certificate** you can manually add it by opening the metadata URL in a browser, copying the certificate value, and use a tool like [OneLogin's X.509 formatter](https://www.samltool.com/format_x509cert.php) that can format the certificate for you. Then save the correctly formatted certificate to a file and upload it to the **Identity Provider Public Certificate** field in the Mattermost System Console.
|
|
- If Mattermost can not pull the metadata and is throwing a connection issue enable debug logging and see if you need to add your Keycloak url to the **Allowed Untrusted Internal Connections** list in the System Console under **Environment \> Developer** and restart the server. See the [Allowed Untrusted Internal Connections](/administration-guide/configure/environment-configuration-settings#allow-untrusted-internal-connections) documentation for details.
|
|
|
|
</Note>
|
|
|
|
3. Set the below fields:
|
|
|
|
- **Verify Signature**: **false**
|
|
- **Service Provider Login URL**: `http://your-mattermost-url.com/login/sso/saml`
|
|
- **Service Provider Identifier**: `mattermost`
|
|
|
|
The Service Provider Identifier will match the **Client ID** that you configured in the second Keycloak step.
|
|
|
|

|
|
|
|
4. Configure the Encryption using the key you downloaded in step 6 of the Keycloak config.
|
|
|
|
1. Generate the `.crt` file from the `.p12` file.
|
|
|
|
``` console
|
|
openssl pkcs12 -password pass:mattermost -in keystore.p12 -out mattermost.crt -nodes -legacy
|
|
```
|
|
|
|
2. Generate the `.key` file from the `.p12` file.
|
|
|
|
``` console
|
|
openssl pkcs12 -password pass:mattermost -in keystore.p12 -out mattermost.key -nodes -nocerts -legacy
|
|
```
|
|
|
|
3. Upload both of these files within the Mattermost System Console. Make sure to select **Upload**.
|
|
|
|
> - **Service Provider Private Key**: `mattermost.key`
|
|
> - **Service Provider Private Certificate**: `mattermost.crt`
|
|
> - **Sign Request**: **true**
|
|
> - **Signature Algorithm**: `RSAwithSHA256`
|
|
> - **Canonicalization Algorithm**: `Exclusive XML Canonicalization 1.0 (omits comments)`
|
|
>
|
|
> 
|
|
|
|
5. Set attributes for the SAML Assertions, which will update user information in Mattermost.
|
|
|
|
The attributes below are from steps 7 and 8 above. These values must be the **SAML Attribute Name** within Keycloak. See [documentation on SAML configuration settings](/administration-guide/configure/authentication-configuration-settings#saml-20) for more details.
|
|
|
|
- **Email Attribute**: `email`
|
|
- **Username Attribute**: `username`
|
|
- **Id Attribute**: `id`
|
|
|
|

|
|
|
|
6. Select **Save**.
|
|
|
|
To confirm SAML is working correctly, log out of Mattermost or open Mattermost in a new Incognito Browser Window and select **Sign in with SAML** on the login page and login with an existing Keycloak account.
|
|
|
|
If you have existing users in Mattermost that are going to be migrated to SAML login, make sure to plan for user migration and update your users accordingly.
|
|
|
|
You may also configure SAML for Keycloak by editing `config.json`. Before starting the Mattermost server, edit `config.json` to enable SAML based on [SAML configuration settings](/administration-guide/configure/authentication-configuration-settings#saml-20). You must restart the Mattermost server for the changes to take effect.
|
|
|
|
## Configuing a SAML user as a Guest in Keycloak
|
|
|
|
1. In Mattermost, go to **System Console \> Authentication \> SAML**.
|
|
|
|
2. Set the **Guest Attribute** to designate which SAML users are guests.
|
|
|
|

|
|
|
|
3. In the Keycloak administration interface, add a user attribute mapper for guests.
|
|
|
|
> 1. Select **Clients** from the LHS menu.
|
|
> 2. Select **mattermost** from the list.
|
|
>
|
|
> > - Select the *Client Scopes* tab
|
|
> > - Select *mattermost dedicated* from the list of scopes
|
|
> > - Click the *Add mapper* drop down and select *By configuration*
|
|
> > - Select *User Attribute* on the model that opens
|
|
> > - Add values for *Name*, *User Attribute* and *SAML Attribute Name* as shown
|
|
> >
|
|
> > 
|
|
|
|
4. In Keycloak specify which users are guest by adding the attribute under **User details**
|
|
|
|
> 1. Select **Users** from the LHS menu.
|
|
> 2. Select the username of the desired user.
|
|
> 3. Select the **Attribute** tab and select **+ add an attribute**.
|
|
> 4. Add the key and value.
|
|
>
|
|
> > 
|
|
|
|
<Inc0_sso_saml_ldapsync />
|
|
|
|
<Inc1_sso_saml_faq />
|
|
:start-after: :nosearch:
|