Rocket.Chat Active Directory sync and LDAP role mapping

Rocket.Chat authenticates and syncs users from Active Directory over LDAP, and group-to-role mapping is a paid-plan capability. This page covers the build sequence, mapping decisions, tests and failure points.

On this page

How Rocket.Chat syncs Active Directory users and groups

A team that wants staff to sign in with their directory accounts, and wants Active Directory group membership to decide Rocket.Chat roles, should use Rocket.Chat's built-in LDAP and Active Directory authentication. That is the supported method for this job, and it is the piece to design before anything else. The Starter plan includes LDAP and Active Directory authentication, but mapping LDAP or SAML user groups to Rocket.Chat is listed on the paid plans, so confirm that requirement against the plan you intend to buy before you promise group-driven roles to the business.

Background sync is the mechanism that keeps Rocket.Chat aligned with the directory after the first login. Rocket.Chat periodically reads user records from the directory and updates local account data, such as names, email addresses and active status, so that disabled or departed staff stop being able to use the workspace. Group-based role assignment depends on the same directory read, so the sync design also decides how quickly a change in AD group membership reaches Rocket.Chat. Treat the sync interval and the handling of accounts that disappear from the directory as design decisions, not defaults you accept by accident.

Exact setting names, menu locations and defaults change between releases, so confirm them in the Administration area of the Rocket.Chat version you run, not in older guides or this page. Record the values you choose for the sync schedule, the user and group search bases, the attribute that identifies each user, and the behavior for deactivated accounts. Those values are what your security and identity teams will ask to review, and they are the baseline you test against in the sections that follow.

What you need in place before connecting Rocket.Chat to AD

Connecting Rocket.Chat to Active Directory touches the Rocket.Chat version, its database, the directory service account, the network path, certificates, group design and the plan you license. Each item below is a decision or check that has to be settled before the first sync runs against production users.

Supported Rocket.Chat version and database

Confirm the Rocket.Chat line you will run is still within its support window before you build sync on it. Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, so check the MongoDB version and replica set status on the target cluster first. Standard releases are supported for 6 months and LTS releases for 12 months, so plan the upgrade path alongside the directory work.

System requirements

Read-only directory service account

Create a dedicated bind account with read access to the user and group objects that Rocket.Chat needs, and nothing more. Agree who owns the account, how its password is rotated, and where the credential is stored, because a rotation that breaks the bind stops every login and background sync at once. Ask your directory team to document that password process before go-live.

Network paths to domain controllers

Rocket.Chat must reach your domain controllers on the LDAP ports your environment uses, from the network segment where the Rocket.Chat servers actually run. Confirm firewall rules in both directions, including any load balancer or NAT in front of the domain controllers. Test the path from the production Rocket.Chat hosts themselves, not from a workstation, because a test from the wrong subnet proves little.

TLS and certificate chain for LDAPS

Plan LDAPS with a certificate chain that Rocket.Chat trusts, including any internal certificate authority root and intermediate. A chain that works in a browser can still fail for the Rocket.Chat process if the internal CA is missing from its trust store. Verify the chain from the Rocket.Chat host and record the certificate expiry date so renewal is scheduled, not discovered during an outage.

AD group design and named owners

Map which AD groups will drive Rocket.Chat roles before you configure any mapping. Agree naming conventions, confirm that each group has a named owner who approves membership changes, and remove stale or nested groups that would grant unintended roles. Role mapping is only as trustworthy as the group structure behind it, so this design step often takes longer than the Rocket.Chat configuration itself.

Plan tier covering group mapping

Confirm in writing that your Rocket.Chat plan includes LDAP and Active Directory group mapping. The free Starter plan includes LDAP and Active Directory authentication, but the paid plans list LDAP and SAML user group mapping as a feature, so check which features your chosen tier covers before you design the role model. Ask for the feature list in the quote, not only the plan name.

Starter user limit
50
Rocket.Chat plans

How login and sync requests move between Rocket.Chat and Active Directory

The diagram starts with a user signing in to Rocket.Chat from the application zone. Rocket.Chat binds to a domain controller across the trust boundary using the service account, searches for the user, and checks the password. A separate background sync path refreshes profile fields and group membership, and Rocket.Chat then applies role mappings locally. Check that the service account is the only identity used for searches, and that the boundary is enforced by firewall rules and LDAPS.

Login, background sync and role assignment flow across the trust boundary between Rocket.Chat and the directory.

Configuring the LDAP connection and testing searches before go-live

This sequence takes the directory from a read-only service account to a tested Rocket.Chat LDAP connection, verified user and group searches, scheduled background sync and group-to-role mapping on a staging instance. Each step closes with a check you can record before production is touched.

  1. Create a read-only directory service account

    A directory administrator creates a dedicated service account in the domain that Rocket.Chat will use to bind and search. The account should have read access to the user and group objects under the search base and no write or administrative rights. Store its password in your secrets management process, not in a shared document. Record the account's distinguished name and the OU or container it reads from. Done means the account exists, its password is stored, and a directory administrator confirms in writing that it has no write permissions on the search scope. Confirm the exact delegation approach with your own directory team, since it depends on how your domain is structured.

  2. Confirm LDAPS and the certificate chain

    From the Rocket.Chat host or a machine on the same network path, open a TLS connection to the domain controller on the LDAPS port and check that the certificate is presented, unexpired and issued to the name you will enter in Rocket.Chat. Confirm that the full chain, including any internal certificate authority, is trusted by the Rocket.Chat container or host. Plain LDAP should be treated as a fallback to avoid, because credentials for the service account would travel unencrypted. Done means the TLS handshake succeeds, the certificate name matches the hostname, and the chain validates without warnings from the test tool you used.

  3. Enter server and base search settings

    In the Rocket.Chat administration area, open the LDAP settings and enter the server host, port, and the LDAPS protocol option. Enter the service account's distinguished name and password, the base distinguished name for users, and the base for groups if group lookups will be used. Set the username and unique identifier attributes to the values your directory uses, which are commonly account name and object GUID, but confirm them against a real user entry. Keep the authentication setting enabled only after the connection test in the next step succeeds. Done means the settings are saved on the staging instance and the values match the entries you recorded in the earlier steps.

  4. Run the connection test

    Use the connection test in the LDAP settings to confirm that Rocket.Chat can reach the server, bind with the service account and complete the protocol handshake. If the test fails, check the error against the account's password, the DN format, the port and the certificate trust from the second step before changing anything else. Inspect the Rocket.Chat server logs for the same attempt. Done means the test reports a successful bind and no certificate or timeout error. Note the timestamp and the account used, since the auditor will ask for this evidence later.

  5. Test user and group searches with a known account

    Choose a test user who belongs to at least two groups, with one group that will map to a Rocket.Chat role and one that will not. Run the user search with that account name and confirm that the returned entry includes the expected email address, display name and username attribute. Then run the group search and compare the number of groups returned with the number you counted in the directory for the same search base. Tell the directory team which group names matter for mapping. Done means the test account is returned with correct attributes and the group count matches the directory count for that scope.

  6. Enable background sync on a schedule

    Turn on background sync for users and enable group sync if your role mapping depends on group membership. Choose a sync interval that suits how often your directory changes, and ask the directory team how quickly they need joiners, movers and leavers to take effect. Confirm whether deactivated accounts should be disabled in Rocket.Chat through the sync or through your own offboarding, and document which applies. Done means a sync run completes without errors in the logs, and a test change made in the directory, such as an attribute update on the test account, appears in Rocket.Chat after the next scheduled run.

  7. Map groups to roles on a staging instance

    On the staging instance only, configure the mapping from directory group names to Rocket.Chat roles, starting with one low-privilege role. Add the test account to the mapped group in the directory, wait for the next sync or force a login if your configuration supports it, and then check the test account's roles in the Rocket.Chat administration area. Remove the account from the group and confirm the role is removed on the next sync. Done means the role is added and removed as expected on the test account, and the group-to-role table is saved and exported for the change record. Confirm the exact behavior for your plan and version, including whether removal is applied automatically, before production rollout.

Mapping AD attributes and groups to Rocket.Chat users and roles

This table pairs each Active Directory source, such as an attribute or group, with the Rocket.Chat field it feeds, the team that owns the value, and the check to run before go-live. Read it as a sign-off sheet: any row without a named owner or a passed check is a risk to resolve before users sync. Field names vary by version, so confirm each one in the admin console for your release.

AD sourceRocket.Chat targetWho owns the valueCheck to run
sAMAccountName or userPrincipalName (login identifier)Username, which must be unique and stableDirectory team, with the help desk for renamed accountsSearch three test accounts and confirm each username is unique and matches the expected login
mail attributeEmail address used for notifications and 2FA email codesDirectory team and HR data ownerConfirm every test user has a mail value and that duplicates or shared mailboxes are excluded
displayName or givenName plus snDisplay name shown in messages and member listsHR or the directory team, depending on who maintains namesCompare two sample profiles against the directory and check how non-Latin characters display
Security group granting a global role (for example, a Rocket.Chat user group)Global role assignment through group mappingApplication owner, approved by the security teamConfirm membership is limited to approved staff and that a test user in the group receives only the intended role
Admin or privileged group in ADShould not grant the admin role automaticallySecurity teamVerify that membership in this group does not map to admin and that admin rights are granted only by a named Rocket.Chat administrator
Nested group membershipWhether nested groups are resolved when mapping rolesDirectory teamTest a user who is only a member through a nested group and confirm the expected outcome in the admin console for your version
Disabled or expired account flag (userAccountControl)Account deactivation or auto-logout behaviorDirectory team and HR offboarding ownerDisable a test account and confirm sync or conditional logout removes its access within the period you agree on
Group mapping configurationMapping rules, reviewed on every releasePlatform owner, with a named backupRecord the mapping in a change log and repeat the test searches after each Rocket.Chat upgrade

Choosing the mapping approach by plan and deployment size

The free Starter plan includes LDAP and Active Directory authentication, so directory users can sign in with their domain credentials. Group mapping is part of the paid plans, so on Starter you assign roles inside Rocket.Chat by hand. This keeps the initial build small, but ongoing access reviews fall to the workspace administrator, who must record each role change.

  • Authentication only: configure the LDAP connection so users sign in with directory credentials, then assign roles after first login.
  • Manual role assignment: new users receive default roles, so administrators promote moderators or admins by hand and keep a written record of each change.
  • Departures: confirm how disabled or removed directory accounts are handled, because without mapping, access depends on sync behavior you verify in testing.
  • Test plan: test sign-in for each user population, a wrong password, a disabled account, and a search filter that returns the expected set of users.

Before go-live, confirm the user count and the plan limit, because growth beyond 50 users moves the workspace out of this approach.

Securing the directory connection and the roles it grants

The LDAP connection and the group mappings it drives decide who can reach Rocket.Chat and what they can do once inside. Each control below closes a gap that sits between the directory, the sync job and the admin console, so review them together before go-live.

Least-privilege service account rights

Rocket.Chat binds to Active Directory with a service account to run searches and background sync. Give that account read access to the user and group objects it needs and nothing more, with no rights to modify directory data or sign in interactively. Confirm with your directory team which attributes the sync reads, and document the account owner, so a compromise of the Rocket.Chat server cannot change group membership in AD.

LDAPS only with certificate validation

Enable LDAP over TLS (LDAPS) for every connection from Rocket.Chat to the domain controllers, and turn on certificate validation so the server trusts only your internal certificate authority. Plain LDAP sends the bind credentials and directory data in clear text. Test the connection against each domain controller you list, since a single unvalidated server in the list weakens the whole setup.

Limit which groups grant admin or moderator

A mapping that gives the Admin or Moderator role to a broad AD group turns every member of that group into a Rocket.Chat administrator. Map privileged roles only to narrow, owned security groups, and keep the mapping table short enough that an administrator can read it in one sitting. Ask the directory team who can add members to each mapped group, because that person effectively grants Rocket.Chat access.

Review group changes that flow into Rocket.Chat

Once a group is mapped, adding a user to it changes their Rocket.Chat role at the next sync or login, without any action in Rocket.Chat. Put the mapped groups under the same change control as other privileged AD groups, and schedule a periodic comparison of group members against the roles Rocket.Chat holds. Expect that a user removed from a group loses the mapped role only when the sync runs, so confirm the interval you rely on.

Protect the bind password

The service account password is the one credential that lets anyone reading the Rocket.Chat configuration reach the directory. Store it in your secrets management process rather than in a shared document or a ticket, restrict who can view the admin settings page, and rotate it on your standard schedule and when staff with access leave. Record where the password lives so a rotation does not break sync silently.

Log and review role changes

Role changes that come from directory sync are easy to miss because no administrator performed them. Keep Rocket.Chat audit logs and directory logs for role-relevant events, and review them on a set cadence for unexpected admin or moderator grants. Check whether your Rocket.Chat plan includes the audit trail features you need before relying on it, and confirm retention with your compliance owner.

Common sync and role mapping failures and how to fix them

This table pairs each common Rocket.Chat Active Directory sync or role mapping symptom with its likely cause and the check to run next. Work through the rows in order when a sync or login problem appears, since several symptoms share the same root cause. Confirm the exact setting names and plan requirements in your installed version before changing anything in production.

SymptomLikely causeFix and next check
Bind fails and no users are returnedThe service account password was changed or expired, or the account is locked or lacks read rights to the user containerReset the service account credentials in the LDAP settings, then test the bind with an LDAP client from the Rocket.Chat host using the same distinguished name. Confirm the account can read the search base.
LDAPS connection errors or certificate validation failuresThe domain controller certificate is not trusted by the Rocket.Chat container, the certificate name does not match the host, or the chain is incompleteImport the internal root and intermediate certificates into the trust store used by Rocket.Chat, and confirm the host name matches the certificate subject. Test the TLS handshake from the Rocket.Chat host before retrying sync.
User logs in but has no role or only basic accessGroup mapping is not configured, the group name does not match the AD group exactly, or the user is not a member of a mapped groupCheck the mapping entries against the group's common name in AD, then confirm the user's group membership with a directory query. Run a sync or sign in again after correcting the mapping.
Role change in AD does not appear in Rocket.ChatRoles are applied at sync or next login, not in real time, so the change is waiting for the next cycleCheck the background sync schedule and the time of the last successful sync in the administration log. Ask the user to sign out and back in if the change is urgent, then confirm the role in the user record.
Former employee still has access after leaving ADThe account is disabled in AD but the sync that deactivates it in Rocket.Chat has not run, or the conditional auto-logout setting does not match your policyConfirm the account is disabled in AD, then verify the sync deactivates users and that auto-logout runs on the attribute you chose. Review active sessions for the user and end them manually if needed.
Sync returns no users or only a few usersThe search base points to the wrong organizational unit, the scope is set to one level when subtree is needed, or the filter excludes the accountsRun the search from an LDAP client with the same base, scope and filter. Adjust the search base to the parent container that holds the users, then rerun a test search in Rocket.Chat before go-live.
Group mapping option is missing or disabledThe group mapping feature requires a paid plan from the version you run, and the workspace is on a plan that does not include itCompare your plan on the official plans page and confirm the feature for your installed version. Ask your account contact for a written quote if an upgrade is needed before you expand mapping.
Sync runs but duplicate or mismatched accounts appearUsername or email attributes differ between AD and existing Rocket.Chat accounts, so the sync creates new users instead of matching themCompare the username and email attributes on a sample account with the values stored in Rocket.Chat. Align the attribute mapping and test with one account before running a full sync.

What happens to accounts when AD removes access

The key question for this section is whether a user who is disabled in Active Directory or dropped from a mapped group still holds a working session in Rocket.Chat, and that answer depends on two things: how often the background sync runs and how the conditional auto-logout behaves for existing sessions. Directory changes do not reach Rocket.Chat at the moment they happen. Between a change in AD and the next sync, the account may still be active in Rocket.Chat, and any session that was already open can keep working until it expires or is ended. Before go-live, confirm with your own environment how the sync schedule is configured on your version, and write down the maximum window you are willing to accept for a disabled user to remain able to post, read or download files.

Session lifetime and device management decide what happens after that window opens. A user who signs in on a shared workstation, a kiosk or a lost phone may keep an active session even after the directory has moved on, so the sync alone does not close that path. Confirm which settings govern session expiry and conditional auto-logout on your plan, and whether a disabled user is logged out in practice or only blocked from logging in again. Device management, where your plan includes it (see the device management topic in this group), lets an administrator see which clients each user is signed in on and end those sessions directly. Plan a written procedure for offboarding that covers both the directory change and an explicit session logout, rather than relying on one step to do both.

Test this with a dedicated disabled test account before go-live. Create a test user in a test OU, add it to a mapped group so it receives a Rocket.Chat role, and sign in on two browsers and one mobile client. Disable the account in AD, then wait for the next scheduled sync and record when each session stops working, when the role is removed and whether the user can still open files or receive notifications. Repeat the test with the user removed from the group instead of disabled, since the two cases can behave differently. Keep the results with your change records so your security team can compare them with the access review evidence they collect.

Questions buyers ask before connecting Rocket.Chat to Active Directory

What drives the cost and effort of an Active Directory integration with Rocket.Chat?

The biggest drivers are how many directory sources and domains are involved, how cleanly groups are structured, and how many Rocket.Chat roles need to map to AD groups. A single domain with well-named security groups and a small role model is far less work than several forests with nested groups and per-department permissions. Other factors include whether LDAP is reachable over TLS from the Rocket.Chat servers, whether service account rights must be approved by the directory team, and how many test cycles the role model needs. Cost has two parts: one-time design, configuration and testing, and any recurring support or upgrade work afterward. Ask for a quote that lists each directory source, the group-to-role map, the test cases and who performs each step, since the written scope is what the quote is built from.

Can our internal admins set up AD sync and LDAP role mapping without outside help?

Often yes, if the team already runs Rocket.Chat in production and has someone who can work with the directory team on service accounts, certificates and group design. The work is mostly configuration, but mistakes are easy to make: a search filter that returns the wrong users, a background sync that removes accounts unexpectedly, or a group mapping that grants administrator rights. Before deciding, check whether the team has done LDAP queries against AD, can read the group schema, and has a non-production instance to test in. An outside partner adds the most value in the design and testing steps, where a fixed-scope engagement can document the decisions and verification steps for your own team to repeat.

What does the AD team and the Rocket.Chat owner each need to provide?

The directory team needs to provide a read-only service account with the minimum rights for the search bases in scope, the LDAP host names and certificate chain for TLS, and confirmation of which AD groups are the authoritative source for each role. They also need to agree on who can change those groups, because every membership change flows into Rocket.Chat. The Rocket.Chat owner needs to define the target role model, decide whether sync should deactivate or only log removed users, approve the test plan, and confirm the plan tier. Both teams should sign off on the test searches before go-live, since that is where most disagreements about scope surface.

How long does testing take, and what sets that time?

No testing duration is supplied for this topic, so confirm the schedule in the written scope rather than relying on a general figure. Testing time depends on the number of search bases, the number of group-to-role mappings, whether nested groups are used, the number of user populations (employees, contractors, guests), and how many accounts are used to verify edge cases such as disabled users, renamed accounts and users in several groups. Plan for at least one round of search testing in a non-production instance and a repeat after any directory change. Ask the vendor to show which test cases are covered, what evidence is recorded, and how retesting is handled if the directory structure changes later.

Which Rocket.Chat plan is needed for LDAP role mapping?

Rocket.Chat's free Starter plan includes LDAP and Active Directory authentication, but the plans page lists LDAP and SAML user group mapping among paid plan features. The Rocket.Chat pricing page places group mapping, Active Directory and MFA in its paid plans, and the Starter plan allows up to 50 users. Confirm the current plan details on Rocket.Chat's plans page before you commit, because feature placement can change between releases. Also check the release line you run: the premium requirement for some identity settings is tied to the 9.0 line, so confirm the requirement for your target version. The plan decision should be in the written scope, since it affects licensing cost and the design of role mapping.

Does the integration change if the directory is OpenLDAP or sits behind AD FS?

Yes, the search and mapping work changes, but the design steps stay the same. OpenLDAP uses its own schema and access controls, so attribute names, object classes and group types (such as groupOfNames) must be checked against the Rocket.Chat LDAP settings rather than assumed to match AD. OpenLDAP also supports TLS and SASL, and multi-provider replication is available when a single point of failure is not acceptable, so the directory's own availability design matters. If users sign in through AD FS, the LDAP sync may still be needed for background user and group data, but authentication and claims are handled by SAML, so role logic must be tested in both paths. Confirm which path authenticates users and which supplies group data before scoping the work.

How DeployOpen works on this

DeployOpen plans and implements Rocket.Chat directory integration inside your own infrastructure, starting from how your Active Directory groups map to the roles people need. We scope the search filters, group-to-role rules and premium requirements in writing, then test them against your directory before anyone signs in at go-live.

How we scope

  • We confirm your Rocket.Chat plan, since LDAP role mapping depends on paid features from the 9.0 line onward.
  • We inventory which AD groups should map to which Rocket.Chat roles, and who approves each mapping.
  • The written scope lists the directory servers, search bases, sync intervals and auto-logout rules covered.

How we build

  • We configure the LDAP connection, TLS settings and service account with read-only directory permissions.
  • We build and test LDAP search filters and group-to-role rules against sample accounts before enabling sync.
  • We run a staged sync against a test instance so role changes and deprovisioning behave as documented.

How we hand over

  • You receive the final mapping table, search filters and configuration values with the reasons behind each rule.
  • We document the test cases, results and the steps to repeat them after an upgrade or directory change.
  • Your team gets a runbook covering failed syncs, service account rotation and how to add a new group mapping.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, version upgrades and continuous testing are available as a retainer for your Rocket.Chat instance.
  • We can retest mappings after Rocket.Chat upgrades, since unsupported versions stop receiving security fixes and client support.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.