Why teams pair Mattermost SAML with AD/LDAP sync
SAML alone does not perform periodic attribute updates or deprovisioning in Mattermost, so a user who leaves your organization can keep a working account, and a changed job title or manager stays stale, until someone acts on it. AD/LDAP synchronization is the documented way to close that gap. Once it is enabled alongside SAML, Mattermost reads the directory on a schedule, refreshes profile attributes, and deactivates accounts for users who no longer exist or no longer match the sync filters. SAML still handles sign-in, while the directory sync handles the lifecycle.
Pair the two when your joiner, mover and leaver process depends on the directory. If your HR and identity system is the source of truth, and you need leavers to lose Mattermost access without a manual step in the System Console, the pairing is the usual answer. SAML alone suits a smaller team that accepts manual deactivation, or one that handles offboarding through a separate control. Before you commit, confirm which directory attribute will serve as the stable identifier, which filter defines an active user, and who owns the sync schedule and its failure alerts. Check the current sync and SAML settings against your own directory, because the exact behavior depends on your configuration and Mattermost version.
The pairing has a licensing consequence you should price in early. The Mattermost pricing page lists SSO, including SAML, and AD/LDAP user sync as included from the Professional plan, so both controls are available at that level without moving to Enterprise. Confirm the plan with Mattermost sales for your seat count, since the pricing page lists no public prices and plans are sold as prepaid annual subscriptions by seat. Ask whether any sync-related feature you rely on sits outside the plan you are quoting.
How SAML sign-in and LDAP sync divide the work
The diagram starts with a user opening Mattermost in a browser, who is sent to the identity provider for SAML sign-in. The directory is a separate trust zone that Mattermost reaches on a schedule through AD/LDAP sync, which updates profile attributes and deactivates accounts that no longer exist there. Both paths write to the same Mattermost user record, so the check to make is that the identity provider and the directory share the same stable identifier for each person.
SAML handles sign-in while scheduled LDAP sync maintains the same user record.
Which sync and identity configuration fits which situation
With SAML only, the identity provider handles sign-in and Mattermost trusts the assertion it receives. Mattermost reads the attributes in that assertion when a user signs in, so the account reflects the directory as of the user's last login. Nothing in this setup runs a periodic comparison against the directory, which is the gap this topic addresses.
- Profile updates: name, email and username changes in the directory reach Mattermost at the next sign-in, not on a schedule. Users who rarely sign in can keep outdated profile data for a long time.
- Leavers: disabling a person in the identity provider blocks new sign-ins, but the Mattermost account stays active until an administrator deactivates it in the System Console or through the API.
- Stable identifier: the ID attribute your identity provider sends in the assertion must stay constant for each person. Confirm with your provider which attribute it sends and whether it can change.
- Session behavior: confirm how long an existing Mattermost session remains valid after the identity provider disables the user.
- Best fit: a small population with few joiner and leaver events, where a documented manual deactivation step is acceptable.
Before relying on this option, test a disabled user's access end to end and record who performs the deactivation step.
In this configuration SAML still performs sign-in, and AD/LDAP synchronization runs against the directory on its own schedule. The sync step covers the two gaps SAML leaves: it refreshes profile attributes without waiting for a login, and it deactivates accounts that fall out of the synced population. The identity provider keeps control of authentication, while the directory becomes the source for account lifecycle.
- Profile updates: the sync refreshes profile fields from the directory on the schedule you configure, so changes reach users who have not signed in recently.
- Leavers: when a person is removed from the synced scope, the sync deactivates the Mattermost account, which closes access even if the user never signs in again.
- Stable identifier: the directory's unchanging ID attribute should resolve to the same account the SAML login creates. Verify this mapping with a test user before you widen the sync.
- Scope control: the sync filters and group settings decide who is deactivated. A filter that is too broad or too narrow changes the population, so review it with the directory team.
- Sign-in policy: MFA, password rules and session settings stay with the identity provider, so audit those controls there.
Before go-live, confirm that a user removed from the directory is deactivated by the sync and that the ID mapping matches across both paths.
With AD/LDAP login, users authenticate with directory credentials directly and SAML is not used for sign-in. The directory is then both the login source and the profile source, so one system governs authentication, profile data and deactivation. This removes the second system that the SAML-plus-sync pattern needs to reconcile, at the cost of moving sign-in controls onto the directory integration.
- Profile updates: profile changes flow through the same directory sync that handles login, so there is no separate refresh path to maintain.
- Leavers: disabling the directory account and running the sync deactivates the Mattermost account, and both steps happen in one place.
- Stable identifier: the LDAP ID attribute is the anchor for matching accounts. Choose it before the first user signs in, because changing it later complicates account matching.
- Feature fit: confirm which SAML-based features your plan needs, such as role assignment from assertion attributes, since they do not apply to users who sign in with directory credentials.
- MFA: if you need multi-factor authentication, confirm how it is applied to directory logins before you commit to this option.
Before adopting this option, confirm with your directory team that the ID attribute is stable and that every population you need is reachable through the directory.
Setup sequence for SAML plus AD/LDAP sync
This sequence proves SAML sign-in works for a small test group, aligns the identifiers so both methods resolve to one Mattermost account, and then confirms that directory sync deactivates a leaver. Each step ends with a check you can record before moving to production.
Confirm SAML sign-in for a test group
The Mattermost administrator configures SAML in the System Console, using the settings from your identity provider, and assigns two or three test accounts that represent typical users. Test sign-in in a non-production instance first, and confirm each account lands on the correct Mattermost user with the expected name and email. Do not proceed until every test account signs in through the identity provider and no duplicate account appears. Record the working login path, because later steps depend on it.
Match the user identifier and email attributes
Decide which directory attribute will serve as the stable identifier that both SAML and LDAP send, and confirm that the SAML assertion and the LDAP sync settings read the same value. Email and username mappings must also agree, since a mismatch is the most common cause of a second account being created for the same person. Compare the attribute values for one test user in the identity provider, in the directory and in the Mattermost user record. The check is that all three match exactly, including letter case if your configuration is case sensitive. Confirm the exact attribute names with your identity provider vendor and with Mattermost's current SAML and LDAP documentation.
Scope AD/LDAP sync filters to intended users
Configure the LDAP connection and the user search base, then add filters so that sync reads only the people who should have Mattermost accounts, such as members of a named group. Keep the filter narrow at first, and document it as part of the change record so an auditor can see who controls membership. Run the sync from the System Console in the test environment and count the accounts it touches against the expected group membership. The check is that no account outside the intended group is created, updated or deactivated.
Run a sync in the test environment
Trigger a full sync in the test environment and review the sync output or logs for each user it processes. Confirm that existing SAML-created accounts are matched and updated rather than duplicated, and that profile fields such as name, position and email refresh from the directory. Repeat the sync once more to confirm it is idempotent, meaning a second run makes no new changes. The check is a clean log with no duplicate accounts and no unexpected errors for the test group.
Test a disabled account for deactivation
Disable one test account in the directory, then run the sync again, or wait for the scheduled sync if your configuration uses one. Confirm in the Mattermost System Console that the user is deactivated and that the account can no longer sign in, either through SAML or through LDAP. Also confirm that the identity provider blocks the same person, since SAML sign-in alone will not catch a leaver if the sync is not working. The check is that the test account shows as deactivated in Mattermost and that a sign-in attempt is refused.
Record results and approve production rollout
Document the identity provider settings, attribute mappings, sync filters, sync schedule and the results of each check in a single change record. Have the identity and security owners review that record, and confirm the production configuration matches what was tested, including the filter scope. Schedule a production check on a small group before the full population is included. The output is an approved change record that shows each step passed, which your compliance team can use as evidence of how leavers are handled.
How SAML and directory accounts stay matched
The SAML and directory sides of this setup only work together if they agree on who a user is. Mattermost has to match the account that arrives in a SAML assertion to the account that the AD/LDAP sync reads from the directory, and it does that through identifiers and attributes such as the email address, the username and the directory's stable ID. If the SAML attribute that carries the email or username does not line up with the directory attribute that the sync uses, Mattermost can see two different records for one person. Confirm the exact attribute names, the ID attribute setting and the username mapping against the current Mattermost SAML and AD/LDAP documentation before you configure either side, because these names change between versions.
When the two sides disagree, the usual result is a duplicate account. A user signs in through SAML and Mattermost creates a new account, while the synced record that the directory deactivates on departure is a different one. The old account then keeps its channel memberships and message history, and the new one keeps working after the person has left. This is why duplicate accounts are the main failure to test for. Before rollout, run a small pilot group through first sign-in, a profile change in the directory and a deactivation, and check the System Console user list for a second account with the same person's details. Repeat the check for an account whose username contains a space, a hyphen or a changed surname, since those are the cases where mapping rules most often diverge.
Plan the mapping as a written decision, not a default. Record which attribute is the identifier for each source, who owns the mapping rule on the identity side and the directory side, and what the team will do with any existing accounts created before SAML was turned on. Accounts created under email login may need to be moved onto the SAML or LDAP method with the documented migration tooling, and that step should be tested on a copy before it touches production users. A mismatch found during the pilot is cheap to fix. The same mismatch found after several hundred users have posted messages is expensive to clean up.
Security and operational considerations
Combining SAML with AD/LDAP sync gives Mattermost a sign-in path and a leaver path, but each part depends on the other. The cards below cover the directory account, the filter, sync health, logging, certificates and testing that decide whether a departed employee actually loses access.
Directory service account privileges
The sync runs as a bind account that reads users and groups from the directory and, when deactivation is enabled, must be able to see account state changes. Grant it read access to the search base and the attributes Mattermost maps, and nothing that allows writes to directory objects. Confirm with your directory team which attributes the account can read, and record who owns its password and rotation schedule. A bind account with broad rights widens the damage if its credentials leak.
SAML SSO docsFilter scope and wrong deactivations
The user filter and search base decide which accounts Mattermost treats as in scope. A filter that is too narrow can deactivate active employees who fall outside it, and a filter that changes during a directory reorganization can remove whole groups at once. Test the filter against a list of known active and known departed users before enabling deactivation. Keep a written record of the filter and review it after any directory restructuring.
Sync failures and leaver removal
Leaver removal only happens when a sync run completes. If the directory is unreachable, the bind fails, or a certificate expires, departed users stay active and keep their sessions until the next successful run. Monitor sync job results and alert on failures, not only on success. Ask your team what the recovery step is when a run fails for a week, because accounts that were due for removal will still be active until someone acts.
Audit trail for deactivations
When an account is deactivated, you need a record of which run did it, which user was affected and when. Export sync and System Console activity into your log pipeline and retain it for the period your policy requires. Bulk deactivations should produce a reviewable list that a second person can check against HR records. Confirm with your Mattermost version which log entries are written for sync-driven changes, since the exact fields can differ between releases.
SAML certificate and encryption handling
The SAML signing and encryption certificates must match what the identity provider holds, and an expired or mismatched certificate blocks sign-in for everyone at once. Track certificate expiry dates in the same calendar as directory credential rotation, and plan the swap so both sides change together. Store private keys in your secrets management system, limit who can read them, and test sign-in after each rotation before the old certificate is removed.
Testing deprovisioning in access reviews
Access reviews should include a test of leaver removal, not only a list of active accounts. Pick a small set of test accounts, disable them in the directory, run a sync, and confirm that Mattermost deactivates them and ends their sessions. Repeat the test after each Mattermost upgrade and after any change to the filter or identity provider. Record the results as evidence for your access review, and keep the test accounts out of production groups.
Questions teams ask before combining SAML and AD/LDAP sync
Can we combine SAML and AD/LDAP sync in-house without a partner?
Yes, a team that already runs its identity provider and directory can do this in-house, provided it has someone who understands both the SAML configuration and the directory schema. The work sits in three places: the identity provider's SAML application and attribute claims, the Mattermost System Console settings for SAML and AD/LDAP sync, and the directory account lifecycle that drives deactivation. The hardest part is usually not the settings themselves but confirming that the user identifiers match across both methods, so that a SAML login and a directory sync point at the same account. A partner adds value mainly when the team lacks time to test or lacks prior experience with the directory or identity provider. Ask any partner for a written scope before work starts.
What drives the effort of combining SAML with AD/LDAP sync?
Effort rises with four factors: the shape of the directory, the number of identity providers, the number of user populations, and the depth of testing. A flat directory with one forest and a clear user object type is simpler than one with nested groups, several domains, or accounts split across organizational units that need different sync filters. Each additional identity provider adds its own attribute mapping and its own test cases. Testing scope matters most for leavers: someone must prove that disabling an account in the directory deactivates the Mattermost user, that active sessions end as expected, and that profile changes such as a new title or manager flow through. Ask any quote to name the directory structure, the identity providers in use and the leaver test cases it covers.
How long does a SAML and AD/LDAP sync rollout take?
The duration depends on how quickly the team can get directory and identity provider changes approved and how many test cycles the rollout needs. Mattermost's documentation covers the settings, but it does not give a general timeline for this combination, so any figure you are given should come with a stated set of assumptions. The main time drivers are change approval for the directory service account, a staging environment that mirrors production user attributes, a test group of real leavers and movers, and a cutover window that avoids disruption for active users. Ask the vendor or partner to break the plan into approval, build, test and cutover stages, and to say which of those stages depends on your own change board.
What must our team provide before the work starts?
Three roles are needed, and they should be named before scoping begins. A directory administrator must provide a read-only service account with access to the user objects, the attributes Mattermost uses, and the groups or organizational units that define the sync scope, along with the sync filter and the attribute that will serve as the stable identifier. An identity provider administrator must provide access to the SAML application, the attribute claims, the signing and encryption certificates, and a way to test sign-in with a non-production user. The Mattermost owner must provide a staging server, a System Console admin account and a set of test accounts covering joiners, movers and leavers. Confirm in writing who owns each item and how long each approval takes in your organization.
Can we replace SAML with LDAP login instead of combining them?
Often you can, but it is a different design with different trade-offs, so it should be a deliberate choice. Mattermost supports signing in with directory credentials through its AD/LDAP login, and AD/LDAP sync can handle deactivation and profile updates without SAML. The question to answer is whether your users need the identity provider's sign-in experience, its MFA policy, conditional access or single sign-on to other applications. If they do, SAML stays in place and AD/LDAP sync covers the gap that SAML leaves for periodic attribute updates and deprovisioning. If your organization is not using a federated identity provider and users sign in with directory passwords on the internal network, LDAP login may be enough. Confirm with your security team which login path meets your policy before you choose.
Which Mattermost plan do we need for SAML and AD/LDAP sync?
According to Mattermost's pricing page, SSO through SAML, OpenID Connect and OAuth, along with AD/LDAP user sync, is included from the Professional plan. High availability clustering and FIPS 140-3 compliance begin at the Enterprise plan, and air-gapped deployment is listed for Enterprise Advanced. Mattermost sells these plans as prepaid annual subscriptions based on seat licenses, but the pricing page does not publish prices and directs buyers to contact sales. Confirm the current plan terms directly with Mattermost before you budget, because plan contents can change. Ask for the quote to state the seat count, the plan, whether it renews annually, and whether any higher-tier feature you need is in scope.
What happens to existing Mattermost users when we turn on sync?
Existing users must be matched to their directory accounts before the sync takes effect, otherwise the sync can create duplicate accounts or deactivate people who were not expected to change. The safest approach is to confirm that the stable identifier used by SAML matches the identifier used by AD/LDAP for every current user, then run the sync against staging with a copy of production accounts. Accounts that exist only in Mattermost, such as former contractors or manually created bots, need a decision about whether they stay, move or are deactivated. Ask your partner or internal team to document the matching rule and the dry-run results before cutover.
Testing the leaver path before production
The leaver path is the part of this design most likely to fail silently, so prove it before any real account depends on it. Create a controlled test account in the directory, sign it in to Mattermost through SAML once so a user record exists, and confirm that it is active and has an open session in a browser and in a desktop or mobile client. Then disable the account in the directory, not in Mattermost, because the directory change is the event you are testing. Record the time of the disable so you can compare it with the sync timestamp afterward.
Next, run the AD/LDAP sync on its normal schedule or trigger it manually from the System Console, and check the sync job output for the test account. Confirm three things: the Mattermost user shows as deactivated, the account no longer appears as an active member in channels or teams, and the existing sessions stop working. A session that keeps working after deactivation is a failed test, and you should find out why before go-live. Also confirm that a SAML sign-in attempt by the disabled user is refused. Repeat the test with a user who is a system admin and one who is a guest, since those roles can behave differently and need their own evidence.
For access reviews, keep a short test record for each run: the test account name, the directory change and its timestamp, the sync run identifier and time, the user state in the System Console before and after, the result of the failed sign-in attempt, and who performed and approved the test. Store the record with the sync configuration and the directory group filters in effect at the time, because a later change to those filters can explain a future failure. This record shows what your team tested and what happened. It does not stand in for an assessment by an independent auditor, so ask your assessor which artifacts they want to see and in what format.
How DeployOpen works on this
DeployOpen plans and builds the SAML and AD/LDAP sync combination inside your own infrastructure, so deactivation and profile updates run from your directory. Engagements are fixed-scope, with the sync rules, test cases and handover agreed in writing before any configuration changes are made.
How we scope
- Review your current SAML identity provider setup and directory structure, including which attributes the provider sends and which directory fields hold the stable identifier.
- Agree in writing which sync filters, deactivation rules and profile attributes the engagement covers, and which systems stay outside it.
- Confirm the Mattermost plan level and server version with your team, since SSO and AD/LDAP sync are included from the Professional plan.
How we build
- Configure the SAML connection and the AD/LDAP sync settings in a staging Mattermost server that mirrors your production identity setup.
- Test leaver deactivation, profile attribute updates and login behavior with named test accounts before any change reaches production.
- Document the attribute mapping, filter logic and the order in which sync and SAML interact, so changes can be reviewed later.
How we hand over
- Deliver a written runbook covering sync schedules, the identifiers that must not change, and the steps to confirm a deactivation worked.
- Provide the test results and a record of each configuration decision, with the owner of each setting named on your side.
- Walk your identity and Mattermost administrators through the runbook and the rollback steps before the engagement closes.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers for teams that want help after handover.
- Retest the sync and deprovisioning behavior after Mattermost server upgrades, since release changes can affect identity settings.
- Confirm with your identity team how retainer scope, response expectations and change control will be written into the agreement.

