How Rocket.Chat custom OAuth with Microsoft 365 works
A team that wants Microsoft 365 accounts to sign in to Rocket.Chat should use custom OAuth against Microsoft Entra ID, configured in Rocket.Chat's OAuth settings. The integration handles authentication only: users sign in with their work accounts, and Rocket.Chat creates or matches the user from the identity claims Microsoft returns. Before you commit to this path, confirm that the design does not depend on Microsoft 365 assigning Rocket.Chat roles, because it does not.
The configuration is built from a handful of endpoints and fields. Rocket.Chat's Office 365 guide uses the tenant-specific login host with /oauth2/token and /oauth2/authorize paths for the v1 endpoints, or the /oauth2/v2.0/ paths together with the Microsoft Graph OIDC userinfo endpoint for v2. Your team must choose one version and configure it consistently, including the client ID, secret, scopes and the field that supplies the username. Confirm with your Entra ID administrator which endpoint version your tenant and app registration expect, and test a sign-in with a non-admin account before rollout.
Roles are the main limit. Rocket.Chat reads roles from the userinfo response, and Microsoft does not populate that response with role data, so global roles cannot currently sync from Office 365. Plan to assign roles inside Rocket.Chat after first sign-in, and document who holds administrator and moderator rights. Also note that from version 9.0, Custom OAuth is limited to the Commercial, Government and Defense plans, so the plan decision belongs in the scope before the build starts. Confirm current behavior against the vendor's guide for your target version.
What you need before configuring Microsoft 365 sign-in
Custom OAuth sign-in with Microsoft 365 depends on four things lining up: a Rocket.Chat version and plan that include Custom OAuth, a tenant identifier, an Entra ID app registration, and a secure public address for Rocket.Chat. Confirm each one before you touch the Administration settings, because a gap in any of them usually shows up as a failed login rather than a clear error.
Supported version and plan
Custom OAuth is limited to Commercial, Government and Defense plans from Rocket.Chat 9.0 onward, so a Starter workspace cannot use this method. Confirm the version line you will run against the current version durability and plans documentation, and check that your plan includes Custom OAuth before you plan the rollout. Record the version in your change request, since the same settings can behave differently across release lines.
Plans docsMicrosoft Entra tenant ID
The tenant ID is the directory identifier that goes into every endpoint URL, so the authorize, token and userinfo paths all depend on it. Confirm the tenant that holds the users who will sign in, especially if your organization has more than one directory or a guest tenant. A wrong tenant ID typically produces an authorization error at the Microsoft sign-in page, not inside Rocket.Chat.
Entra ID app registration
Create an app registration in the same tenant and choose whether Rocket.Chat uses the v1 or v2.0 endpoints, since the paths differ. Decide which account types may sign in, usually only accounts in your organization. Record the application (client) ID, because Rocket.Chat asks for it as the client identifier and it must match the registration exactly.
Redirect URL and client secret
Register the Rocket.Chat callback URL as a web redirect URI in the app registration, and copy it character for character from the Custom OAuth setup screen. Create a client secret and record its value and expiry date at creation, because Entra ID does not show the value again. Assign an owner and a renewal reminder so the sign-in does not stop working when the secret expires.
HTTPS on the Rocket.Chat domain
Microsoft redirects users back to the Rocket.Chat address after sign-in, so that address must be reachable over HTTPS with a valid certificate that your users' browsers trust. Confirm the public site URL configured in Rocket.Chat matches the redirect URI registered in Entra ID, including scheme, host and any path. Mismatches here are the most common cause of redirect errors after an otherwise correct setup.
Choosing v1 or v2 endpoints for the token and userinfo paths
If your Entra ID app registration already exists and is used by other applications, the first question is which token version it issues. The version is set in the application manifest through the accessTokenAcceptedVersion property, and it determines what the access token looks like, not only which URLs you call. Changing that setting can break other applications that already validate tokens from this registration, so the change belongs in a planned window with those owners involved. Rocket.Chat's Office 365 custom OAuth guide documents both path sets, so you can keep the registration as it is and point Rocket.Chat at the matching endpoints.
- Check the manifest first: Confirm the current
accessTokenAcceptedVersionvalue and whether it is set at all, since an unset value does not guarantee the version you expect. - Match the paths to the version: Use the v1 paths for a v1 registration and the v2.0 paths for a v2 registration. Mixing them is a common source of token validation errors.
- Find other consumers: List every application, API and script that uses this registration before changing the token version.
- Avoid a second registration by default: A separate registration for Rocket.Chat can isolate the change, but it adds secrets and consent steps to manage.
- Record the decision: Note which version you chose and why, so later upgrades do not reopen the question.
Confirm the token version in the manifest and in a test sign-in before you change anything in production.
The two paths return identity data in different shapes, and that difference matters for the fields you map in Rocket.Chat. Rocket.Chat reads the user's identifier, email and display name from the userinfo response, and reads roles from the same place. The v2 path uses the Microsoft Graph oidc/userinfo endpoint, which returns standard OpenID Connect claims. The v1 path depends on the claims present in the token and on the userinfo behavior of that endpoint. Do not assume the claim names match across versions, and test each one against a real account before you map it.
- Identifier field: Pick a stable claim, such as the object identifier, for the key field, and avoid a field that users can change.
- Email and name fields: Confirm the email and display name arrive in the response for your tenant, including accounts with no mailbox.
- Optional claims: Some claims need to be added to the token configuration in Entra ID before they appear. Check which ones your mapping requires.
- Roles are not synced: Microsoft does not populate roles in the userinfo response, so role assignment has to be handled in Rocket.Chat itself.
- Test with several accounts: Use a guest account, a member account and a service account to see how the response differs.
Capture a sample userinfo response for each path and compare the claim names before you finalize the field mapping.
Microsoft's identity platform is where new features and documentation land, and the v2.0 endpoints are the path most new integrations target. Choosing v2 generally keeps you closer to the current documentation and the scopes that Microsoft Graph exposes. Choosing v1 may be the right answer for an existing registration that other systems depend on, but it means you will eventually need to plan a move. Rocket.Chat's guide describes both sets of paths, but the team operating the deployment is responsible for checking that the chosen paths still work after each Rocket.Chat and Entra ID change.
- Longer support horizon: Ask your Microsoft account team or check current Microsoft documentation for how long each token version is expected to remain supported.
- Rocket.Chat version alignment: Confirm with Rocket.Chat that the paths you choose are documented for the version you run, since Rocket.Chat versions have defined support windows.
- Plan the move: If you start on v1, record the trigger for migrating, such as a new registration requirement or a planned Rocket.Chat upgrade.
- Test after upgrades: Repeat a sign-in test after each Rocket.Chat upgrade and each change to the app registration.
- Budget the work: The effort for a later move depends on how many applications share the registration, so inventory them now.
Write down the planned move date or trigger, and confirm the support position with Microsoft and Rocket.Chat before you commit.
Whichever version you choose, verify it in a non-production sign-in before the paths go into the production Rocket.Chat settings. A working sign-in alone does not prove the setup is correct. You need to confirm that the token version matches the paths, that the userinfo response carries the claims you mapped, and that the account you expect is created with the expected username and email. Keep a short test record so a reviewer can see what was checked and when.
- Confirm the token version: Decode a test access token or check the registration to verify which version it issues.
- Check the path pairs: Verify that the authorize, token and userinfo URLs all belong to the same version.
- Review the userinfo output: Compare the returned claims against your field mapping for a member account and a guest account.
- Confirm the role position: Verify that no role is expected to come from Microsoft 365, and that roles are assigned in Rocket.Chat by a documented method.
- Keep a rollback path: Note the earlier settings and the registration state so you can revert if the test fails.
Before go-live, confirm the token version your app registration issues and test one sign-in against each path set you might use.
Configuring the Entra ID app and Rocket.Chat custom OAuth
This sequence registers a Microsoft Entra ID application, then connects it to a Rocket.Chat custom OAuth method so that Microsoft 365 users can sign in with their work accounts. Each step ends with a check, and the final test confirms that a standard user can sign in before anyone else is onboarded.
Register the application in Entra ID
An identity administrator opens the Microsoft Entra admin center, goes to App registrations, and creates a new registration for Rocket.Chat. Choose the account types that match your tenant policy, usually single tenant for an internal workforce. Add a Web platform redirect URI once the Rocket.Chat site URL is known (see the redirect step). Under API permissions, confirm the delegated Microsoft Graph permissions the guide requires, such as openid, profile, email and User.Read, and grant admin consent if your tenant requires it. Done means the registration appears in the list with the expected permissions showing as granted.
Record the tenant ID and client ID
From the application's Overview page, copy the Directory (tenant) ID and the Application (client) ID into a secure working document. The tenant ID is needed to build the authorize and token URLs, and the client ID is entered as the OAuth ID in Rocket.Chat. Check both values against the Overview page before you move on, because a single mistyped character produces an error that looks like a permissions problem. Keep the tenant ID in the same file as your change record so the v1 or v2 endpoint choice can be audited later.
Create and store a client secret
Under Certificates & secrets, create a new client secret and set its expiry to a date your identity team can track and renew. Entra ID displays the secret value only once, so copy it immediately into your organization's secret store. Record the expiry date in your renewal calendar, since an expired secret stops sign-in for every user with no warning inside Rocket.Chat. Done means the secret value is stored, not just the secret ID, and a second administrator knows where to find it.
Set the redirect URL on both sides
Build the redirect URL from your Rocket.Chat site URL and the custom OAuth service name you plan to use, following the path pattern in the Office 365 custom OAuth guide. Add that exact URL as a Web redirect URI in the Entra ID registration, then enter the same service name in Rocket.Chat so the two match. A mismatch in scheme, host, trailing slash or name is the most common cause of a failed callback. Done means the URI shows under Authentication in Entra ID and the Rocket.Chat site URL in Administration matches the host you registered.
Enter the endpoints, scopes and client details
In Administration, open the OAuth settings and add a new custom OAuth service. Enter the client ID and secret, then set the authorize, token and userinfo URLs. For v1, use the login.microsoftonline.com tenant paths with /oauth2/authorize and /oauth2/token. For v2, use the /oauth2/v2.0/ paths and the Microsoft Graph oidc/userinfo endpoint, and set the scopes the guide lists for that version. Do not mix v1 and v2 paths in the same configuration. Done means the service saves without validation errors and appears as a login option on the sign-in page.
Set the identity key and username fields
Set the identity key field to the claim that uniquely identifies each user in the userinfo response, and set the username and email fields to the claims your naming policy uses. Confirm these claim names by decoding a token or reviewing the userinfo response for a test account, because claim names differ between v1 and v2 and between tenants. Avoid using a field that users can edit, such as a display name, as the identity key. Done means the claim values for a test user match what you expect in the Rocket.Chat user record after a sign-in.
Test sign-in with a non-admin account
Sign out, open the sign-in page in a private browser window, and sign in with a standard Microsoft 365 user who holds no Rocket.Chat administrator role. Confirm the user is redirected to Microsoft, returns to Rocket.Chat, and lands in the workspace with the expected username and email. Then check the user's record under Administration to confirm the identity key matched. Role assignments will not sync from Microsoft 365 through this method, so assign any required roles manually and document them. Done means the test user can sign in and the result is recorded for the rollout.
Which Microsoft 365 attributes map to Rocket.Chat fields
This table compares the claims Entra ID returns from the userinfo endpoint with the Rocket.Chat fields they populate during custom OAuth sign-in. Read it as a checklist to confirm against your own token output, since claim names and availability depend on app registration and scopes. The main takeaway is that identity, email and name can come from userinfo, but role assignment does not, so it must be managed inside Rocket.Chat.
| Rocket.Chat field | Typical Microsoft 365 claim | What to confirm | Notes |
|---|---|---|---|
| Identity key | sub or oid | Which value is stable per user in your tenant | Choose one identifier and keep it unchanged, because changing it can create duplicate accounts |
| email or preferred_username | Whether email is populated for every licensed user | Some guest or external accounts may lack a mailbox-backed email value | |
| Username | preferred_username or mail nickname | Which claim matches your naming standard | Confirm the value is unique and does not contain characters your policy rejects |
| Name | name or given_name and family_name | Whether display name is returned with the scopes you request | Display name is usually the most reliable field for the user's visible name |
| Roles | Not populated in userinfo | Whether any role claim appears in your token output | Assign roles inside Rocket.Chat, since the userinfo endpoint does not supply them |
| Groups | Not populated by default | Whether group claims are configured in the app registration | Group-based mapping needs a separate design, so do not assume it works from userinfo |
How a Microsoft 365 sign-in reaches Rocket.Chat
The flow starts when a user opens the Rocket.Chat login page and is redirected to the Entra ID authorize endpoint for your tenant. After the user signs in, Microsoft returns an authorization code to Rocket.Chat, which exchanges it at the token endpoint. Rocket.Chat then reads the user's identity from the userinfo endpoint and creates or matches the local account. The trust boundary sits between Microsoft's sign-in service and your self-hosted instance, so check the endpoint paths, the v1 or v2.0 choice, and which claims reach userinfo before go-live.
Sign-in path from the browser through Entra ID back to the self-hosted Rocket.Chat account.
Securing the Microsoft 365 OAuth connection
Custom OAuth turns Entra ID into the front door for every Rocket.Chat sign-in, so the app registration, the users it admits and the redirect configuration deserve the same scrutiny as the server. The controls below cover credentials, who may sign in, MFA, redirect handling and the second factor Rocket.Chat enforces itself.
Protect and rotate the client secret
The Entra ID app registration issues a client secret that Rocket.Chat stores to exchange authorization codes for tokens. Keep it out of screenshots, tickets and shared documents, and store it in the Rocket.Chat administration settings only. Record its expiry date when you create it, and plan a rotation before it lapses, since a lapsed secret stops all Microsoft 365 sign-ins at once. Confirm with your Entra ID administrators who holds permission to create new secrets on the registration.
Office 365 OAuth guideRestrict access to assigned users
By default, many Entra ID tenants let any licensed user authenticate to an enterprise application. Turn on the setting that requires user assignment for the Rocket.Chat application, then assign a security group that matches who should have chat access. This keeps guest accounts, contractors outside the scope and former staff out of the workspace even when their Microsoft 365 credentials still work elsewhere. Check the assignment list after each organizational change.
Enforce MFA with Conditional Access
Rocket.Chat trusts the identity that Entra ID asserts, so the strength of the sign-in depends on the Conditional Access policies applied at Microsoft's side. Create a policy that targets the Rocket.Chat application and requires multi-factor authentication, and consider device compliance or sign-in risk conditions if your tenant licenses them. Test the policy with a pilot group first, because a blocked policy stops sign-in without any error inside Rocket.Chat.
Keep redirect URLs exact
The redirect URI registered in Entra ID must match the URL Rocket.Chat sends during sign-in, including scheme, host, port and path. Mismatches fail, and loose wildcard or extra entries widen the set of places authorization codes can be returned. Register only the production address and a separate test address if you use one, and update both when the public hostname or reverse proxy changes. Remove stale entries left from earlier tests.
Enforce two-factor authentication in Rocket.Chat
Two-factor enforcement inside Rocket.Chat is a second control that applies even if an Entra ID policy is loosened later. Decide which roles, such as administrators and moderators, must enroll, and confirm how OAuth users receive their second-factor codes on your plan before rollout. Document the reset path for lost authenticators, because an administrator has to clear enrollment before the user can sign in again. Ask your vendor or the Rocket.Chat documentation to confirm the per-role options available on your plan.
Why Microsoft 365 sign-in fails in Rocket.Chat
This table lists the failures teams most often hit when wiring Rocket.Chat custom OAuth to Entra ID, with the cause and the fix for each. Read it before go-live, and work through the rows in order because the endpoint and redirect settings are checked first. The main takeaway is that most failures come from the endpoint version, the redirect URI, or the identifier returned by userinfo, and that role sync from Microsoft 365 is not available.
| Failure | Likely cause | Fix to check |
|---|---|---|
| Redirect URI mismatch | The redirect URI registered in the Entra ID app registration does not exactly match the URL Rocket.Chat sends, often because of http versus https, a trailing slash, or a different site URL. | Copy the callback URL shown in the Rocket.Chat custom OAuth settings and register it unchanged in the app registration, then test with the same site URL. |
| v1 and v2 path mix-up | Authorize and token paths from v1 are combined with the v2.0 userinfo endpoint, or the reverse, so tokens and claims do not match. | Use one endpoint set throughout: /oauth2/token and /oauth2/authorize for v1, or the /oauth2/v2.0/ paths with the Microsoft Graph oidc/userinfo endpoint for v2. |
| Missing or wrong scopes | The openid, profile or email scopes are not requested, so userinfo returns fewer attributes than Rocket.Chat expects for the username and email fields. | Confirm the scope string in the Rocket.Chat configuration matches what the chosen endpoint version requires, then sign in with a test account and inspect the returned fields. |
| Userinfo returns no usable identifier | The field Rocket.Chat is set to read for the username or identifier is absent or named differently in the Microsoft response, so login creates no usable account. | Decode a test response, choose a field that is actually present (for example, an email or preferred username claim), and set the key and username fields to match it exactly. |
| Custom OAuth not available on the plan | From 9.0, Custom OAuth is limited to Commercial, Government and Defense plans, so a Starter or Community workspace cannot enable the method. | Confirm the plan with Rocket.Chat before you design around this method, since the paid-plan requirement is set by the version in use. |
| Users expect roles to sync | Rocket.Chat reads roles from the userinfo response, and Microsoft does not populate that response with roles, so Microsoft 365 group or app role membership does not reach Rocket.Chat. | Assign roles inside Rocket.Chat manually or through a separate process, and document who owns role changes for leavers and movers. |
| Login works but users land without expected access | Accounts are created with default roles and no channel membership, which looks like a sign-in failure to the user. | Plan the default role and onboarding channels up front, and test with a non-administrator account before rollout. |
Questions buyers ask about Microsoft 365 sign-in for Rocket.Chat
Can our team configure Microsoft 365 sign-in for Rocket.Chat without outside help?
Yes, if you have an administrator who can register an application in Entra ID and a Rocket.Chat administrator who can add a custom OAuth provider. The work is documented step by step in Rocket.Chat's Office 365 custom OAuth guide, so the question is less about access and more about time, testing and who owns the result after go-live. Teams that have not configured an OAuth provider before often find the endpoint choice and the claim mapping take longer than the portal steps themselves. Before you decide, confirm that someone on your side can test sign-in with real accounts from several user groups and can troubleshoot a failed login without a support ticket.
What drives the effort and cost of a Microsoft 365 sign-in setup?
The cost comes from four components: app registration in Entra ID, choosing and configuring the endpoints, testing against your tenant, and the Rocket.Chat plan that the setup requires. Effort rises when your tenant has conditional access policies, multiple tenants, or several Rocket.Chat workspaces that need separate registrations. Costs fall when the scope is limited to one tenant, one workspace and a defined test group. Any price for the Rocket.Chat plan comes from Rocket.Chat's quote, since its paid plans are priced by quote. Ask any provider for a written quote that lists the app registration, endpoint configuration, test plan, go-live support and handover as separate lines.
How long does a Rocket.Chat Microsoft 365 sign-in configuration take?
The duration depends on your environment more than on the configuration itself. A single tenant with one Rocket.Chat workspace, standard user accounts and an administrator available for approvals is the simplest case. Duration grows with conditional access rules, guest accounts, the number of test scenarios, and how many internal approvals the app registration needs. No fixed duration is supplied here, so ask for a timeline in the written scope and check which of your own dependencies, such as change windows and approvals, sit on the critical path.
Can roles sync from Microsoft 365 into Rocket.Chat?
No, roles cannot currently sync from Microsoft 365 into Rocket.Chat. Rocket.Chat reads roles from the userinfo endpoint, and Microsoft does not populate that endpoint with roles. Plan your role assignments inside Rocket.Chat, or choose a different mechanism for group-based access that your identity team can support. Also confirm the current behavior with Rocket.Chat before you commit to a design, because the documented limitation reflects the guide you should check at the time of setup.
Does the Microsoft 365 sign-in method require a paid Rocket.Chat plan?
From Rocket.Chat 9.0, Custom OAuth is limited to the Commercial, Government and Defense plans, according to Rocket.Chat's Office 365 custom OAuth documentation. The free Starter plan includes single sign-on and LDAP, but the custom OAuth method used for Microsoft 365 sits outside that tier from 9.0 onward. Confirm the plan you need against your target version before you start, because the answer changes with the release you deploy.
Should we use the Entra ID v1 or v2 endpoints for Rocket.Chat?
Rocket.Chat's guide documents both. The v1 setup uses paths under login.microsoftonline.com with your tenant ID, including /oauth2/token and /oauth2/authorize. The v2 setup uses /oauth2/v2.0/ paths and the Microsoft Graph oidc/userinfo endpoint. Choose v2 when you want to align with the current Microsoft identity platform and the userinfo behavior described in the guide, and confirm which endpoints your app registration and claims mapping require. Test sign-in end to end after the change, since a mismatch between endpoint version and claim names is a common cause of failed logins.
What do our Entra ID and Rocket.Chat administrators need to provide?
On the Entra ID side, you need someone who can register the application, create or confirm a client secret, grant the required permissions, and assign users or groups to the app. On the Rocket.Chat side, you need an administrator who can add the custom OAuth provider, set the endpoints and claim fields, and enable the sign-in method for the workspace. Both administrators should agree on the test accounts, the redirect URL, and who approves the client secret rotation schedule. Ask your provider to list these inputs in the written scope so each owner knows what to prepare before work starts.
Who should own Microsoft 365 sign-in after the setup is complete?
Ownership should sit with a named identity team, with a Rocket.Chat administrator as the operational contact. The setup creates recurring tasks: rotating the client secret before expiry, reviewing the plan tier when Rocket.Chat changes its licensing, and retesting sign-in after each Rocket.Chat upgrade. Upgrades matter because unsupported versions stop receiving security fixes, so plan the retest into the upgrade process. Ask any implementation partner whether it offers a retainer for these tasks and what the handover document will contain.
Official Rocket.Chat guide for Office 365 custom OAuth
Treat Rocket.Chat's Office 365 custom OAuth guide as the authoritative source for endpoint paths and setting names, and check it against the Rocket.Chat version you are actually running before you change anything. The guide covers the two Microsoft endpoint families: the v1 paths under /oauth2/token and /oauth2/authorize, and the v2.0 paths with the Microsoft Graph oidc/userinfo endpoint. Pick one family deliberately, because the token, authorize and userinfo URLs must all come from the same generation. Mixing them is one of the more common causes of sign-in failures that look like credential problems. Keep a record of the version and the guide revision you followed so that a later upgrade can be checked against the same steps.
Plan requirements sit in a different document. The guide describes configuration, while the Rocket.Chat plans documentation states which tiers may use custom OAuth. The guide notes that from 9.0 Custom OAuth is limited to the Commercial, Government and Defense plans, so confirm your subscription tier against the plans page before you build the integration, not after. Ask your Rocket.Chat contact to confirm in writing which plan covers your workspace and whether that applies to your deployment model. A Starter workspace that works in testing may stop working for new users once the version or plan changes, so this check belongs in the design phase.
Because the guide is versioned with the product, record which settings it names for your release, including any that differ between the version you run now and the version you plan to move to. Read the guide's notes on role handling alongside the setup steps. The guide states that Rocket.Chat reads roles from the userinfo response and that Microsoft does not populate roles there, so role sync from Microsoft 365 is not available through this path. Your access design therefore needs a separate plan for administrator and role assignment, which the sibling sections on roles and LDAP mapping cover in detail.

