Configure Microsoft Intune Mobile Application Management (MAM)
You can configure the Mattermost Mobile App on iOS to enforce Microsoft Intune App Protection Policies (MAM) so organizational data remains protected on Bring Your Own Device (BYOD) and mixed-use devices without requiring device enrollment (MDM).
This guide documents the required configuration to enable Intune MAM successfully on iOS.
Read This First
Intune MAM enforcement in Mattermost is identity-based and applies only to the sign-in method selected as the enforced Auth Provider in System Console > Environment > Mobile Security.
- The enforced authentication provider must resolve users using Azure AD
objectId(IdAttribute = objectId). - MSAL access tokens must include the
oidclaim, and it must match the same Azure ADobjectId(confirm identity alignment:objectId ↔ oid).
Unsupported Scenarios
This guide doesn't apply when:
- You require Intune MAM on Android devices.
- You want Intune MAM enforcement for a sign-in method not backed by Microsoft Entra ID.
- The enforced authentication provider cannot resolve users to Azure AD
objectId. - You require a rollout model where users can bypass or defer Intune MAM for the enforced sign-in method.
Other authentication methods, such as guest access, may still be enabled separately, but they aren't evaluated by Intune MAM.
Prerequisites
Confirm the following before continuing:
- Microsoft Entra ID is used for authentication.
- You can commit to Azure AD
objectIdas the authoritative identity. - Mattermost Enterprise Advanced licensing is available for the server.
- Target users are licensed for Microsoft Intune.
- You can register applications and grant tenant-wide admin consent in Microsoft Entra.
- If enforcing Intune MAM on SAML, users already exist in Mattermost (mobile sign-in does not create users for SAML).
Configuration Overview
Successful Intune MAM enforcement requires coordinated configuration across:
- Microsoft Entra ID – app registration, scope, API permissions, admin consent
- Microsoft Intune – iOS App Protection Policies
- Mattermost Server – MAM enablement and provider selection
- Mattermost Mobile App (iOS) – enrollment and enforcement
Complete the steps below in order.
Setup Summary
- Confirm identity requirements and alignment (
objectId ↔ oid). - Configure Microsoft Entra (server-referenced application).
- Configure Intune App Protection Policies.
- Enable Intune MAM in Mattermost and select the enforced provider.
- Deploy the official Mattermost iOS app.
- Validate enrollment and enforcement.
Values You’ll Need Later
Capture these during setup:
| Value | Where to get it | Where you use it |
|---|---|---|
| Directory (tenant) ID | Entra app registration overview | Mattermost System Console |
| Application (client) ID | Entra app registration overview | Mattermost System Console |
| Application ID URI | Entra app > Expose an API | Used to form the api://<APPLICATION-ID>/login.mattermost scope reference in Authorized client applications |
login.mattermost scope | Entra app > Expose an API | Authorized client applications |
| Mobile client application ID | Provided by Mattermost | Entra app > Authorized client applications |
| iOS bundle IDs (prod/beta) | This guide | Intune App Protection Policies |
Step 1: Identity Configuration for Intune MAM
This step defines the required identity model for the authentication provider selected for Intune MAM enforcement.
Required Identity Model
Microsoft Intune MAM for Mattermost requires Azure AD objectId as the authoritative user identifier. The following is non-negotiable.
IdAttributemust equalobjectIdfor the enforced provider.- MSAL access tokens must include the
oidclaim. - Confirm identity alignment (
objectId ↔ oid) before enabling Intune MAM.
Confirm Identity Alignment (objectId ↔ oid)
For the same user, the following values must match:
- Azure AD
objectId - MSAL access token
oidclaim - SAML
objectidentifier(if applicable) - LDAP
msDS-aadObjectId(if applicable)
Any mismatch prevents enrollment.
Identity Enforcement by Authentication Method
OIDC (Mobile sign-in via MSAL)
- Mattermost uses the MSAL access token for identity and enrollment.
- Confirm identity alignment (
objectId ↔ oid).
SAML (Entra-backed)
SamlSettings.IdAttributemust map toobjectidentifier.- Email, UPN, and
immutableIDaren't supported. - Users must already exist in Mattermost before mobile sign-in.
LDAP (Entra ID Domain Services)
- Use
msDS-aadObjectId. - Do not use
objectGUID.
Runtime Enforcement Behavior
When Intune MAM is enabled for a provider:
- Enforcement occurs during active sessions, not only at login.
- If Intune MAM becomes newly required due to policy, licensing, or configuration changes, enrollment may be triggered immediately.
- Users can’t bypass enforcement for the enforced provider.
Pre-flight Checklist
- Licensed Intune test user available
- Ability to grant tenant-wide admin consent
- Enforced provider identified (OIDC or SAML)
IdAttribute = objectIdconfigured- Identity alignment verified (
objectId ↔ oid) - Official Mattermost iOS app deployed
- Target bundle IDs known:
com.mattermost.rn(Production),com.mattermost.rnbeta(Beta)
Step 2: Microsoft Entra Configuration for Intune MAM
You register a single-tenant Microsoft Entra application that is referenced by Mattermost Server. This application validates MSAL access tokens and supports Intune MAM enrollment.
You don't register the Mattermost Mobile app itself. Redirect URI configuration isn't required.
Entra Application Registration
- Go to Identity > Applications > App registrations
- Select New registration
- Configure:
- Name: Mattermost Mobile (Intune MAM)
- Supported account types: Single tenant
- Register the app
- Copy:
- Application (client) ID
- Directory (tenant) ID
Expose the API and Create the Scope
- Go to Expose an API
- Confirm Application ID URI is set (for example,
api://<APPLICATION-ID>) - Add a scope named
login.mattermost - Save your changes.
Authorize the Official Mobile Client
Authorize the official Mattermost Mobile client application ID (provided by Mattermost) to request the login.mattermost scope.
- In the Entra app registration, go to Expose an API.
- Under Authorized client applications, select Add a client application.
- Add the official Mattermost Mobile client application ID (provided by Mattermost) as:
- Beta:
64e9952b-20eb-46dc-92ad-99089ed24903- Production:
9ac649f1-4f77-44d6-9792-b2f54ab3c9a7
- Authorize the
api://<APPLICATION-ID>/login.mattermostscope. - Save your changes.
API Permissions and Admin Consent
- Go to API permissions.
- Select Add a permission.
- Add the following Microsoft Graph delegated permissions:
- Microsoft Graph →
email(Delegated) - Microsoft Graph →
profile(Delegated)
- Microsoft Graph →
- Select Grant admin consent for your tenant.
These are the permissions the customer admin must grant for the Entra application referenced by Mattermost Server.
If these permissions are missing or lack tenant-wide admin consent, enrollment can fail with an Entra permissions/admin-consent error (for example, AADSTS650057) or a user-visible Consent Denied message during first sign-in.
Configure MSAL tokens and required claims
Before enabling Intune MAM, ensure the Entra app registration issues access tokens with the claims Mattermost expects during mobile sign-in.
- In the Entra app registration, go to Token configuration.
- Select Add optional claim.
- Under Token type, select Access.
- Add the following optional claims:
emailfamily_namegiven_namepreferred_usernameupn
- Save your changes.
Enable MSAL v2 access tokens
- Open the app Manifest.
- Set the token version to
2:- If your manifest shows
api.requestedAccessTokenVersion, set it to2. - Otherwise set
accessTokenAcceptedVersionto2.
- If your manifest shows
- Save your changes.
Step 3: Configure Intune App Protection Policies
- Go to Intune admin center > Apps > App protection policies.
- Create a policy:
- Platform: iOS/iPadOS
- Targeted app: Managed apps
- Add the Mattermost app by bundle ID:
com.mattermost.rn(Production)com.mattermost.rnbeta(Beta)
- Configure protection settings.
- Assign to Entra ID user groups.
- Save your changes.
Separate policies are required for Production and Beta apps.
Step 4: Configure Mattermost Server for Intune MAM
- Go to System Console > Environment > Mobile Security
- Set Enable Microsoft Intune MAM to True
- Select Auth Provider:
- OpenID Connect (Entra-backed)
- SAML 2.0 (Entra-backed)
- Enter:
- Tenant ID
- Application (Client) ID
- Save your changes.
The enforced provider must resolve identity using IdAttribute = objectId.
Step 5: Deploy the Mattermost iOS App
Download and install the official Mattermost iOS app using:
- Apple App Store (Production)
- TestFlight (Beta)
Wrapped, re-signed, or privately distributed apps aren't supported.
Step 6: Validate Enrollment
Validate with a licensed test user on iOS.
Confirm:
- Enrollment completes successfully
- Enforcement applies at sign-in and mid-session
- Identity alignment is correct (
objectId ↔ oid)
Expected Behavior During Mobile Sign-In
- User signs in via MSAL.
- Mattermost validates the access token.
- Intune MAM enrollment is triggered.
- App Protection Policies are applied.
If enrollment is required but cannot complete, access is blocked until enrollment succeeds.
Troubleshooting
Most failures are caused by:
- Identity mismatch (
objectId ↔ oid) IdAttributenot set toobjectId- Missing Entra API permissions or admin consent
- App Protection Policy not targeting the user or app
- Unsupported client or platform
Quick Diagnostics
- Confirm identity alignment (
objectId ↔ oid). - Confirm
IdAttribute = objectId. - Confirm Entra permissions and admin consent.
- Confirm Auth Provider selection.
- Confirm Intune policy targeting.
If the user declines enrollment, retry is allowed.
Intune MAM Errors
The errors below may occur during mobile sign-in or when Intune MAM enforcement is triggered mid-session. Some errors are shown in the Mattermost Mobile App, while others are silent and must be diagnosed using Mattermost server logs.
| Error | Meaning | Admin cause & next step |
|---|---|---|
| Enrollment Failed | Intune MAM enrollment failed due to a technical error. | Cause: Enrollment could not be completed due to a technical failure (MSAL error, Intune enrollment API failure, identity mismatch, or missing Entra permissions). |
| Enrollment Declined | The user declined Intune MAM enrollment. | Cause: The user canceled the enrollment prompt. |
| Consent Denied | Enrollment cannot complete because required Entra app permissions don’t have tenant-wide admin consent. | Cause: Tenant-wide admin consent has not been granted for the required delegated permissions on the Entra app registration configured in Mattermost Server. |
| (silent) | Intune MAM login is not available on this server. | Cause: The server does not support Intune MAM (feature not available in this build or not enabled for the deployment). |
| (silent) | Intune MAM is enabled for the org but not configured on the server. | Cause: Intune MAM isn't fully configured in System Console > Environment > Mobile Security. |
| Bot accounts cannot sign in using this method. | The account cannot use Intune MAM sign-in. | Cause: Bot accounts are not allowed to authenticate via Intune MAM. |
| Your account has been deactivated. Please contact your administrator. | The account is not permitted to sign in. | Cause: The user is deleted, disabled, or locked in Mattermost. |
| (silent) | Intune MAM is not configured for the current sign-in path. | Cause: Intune MAM isn't configured for the requested authentication path (configuration incomplete or mismatched provider selection). |
| We couldn't complete your sign in. Please try again. | Identity mapping failed during sign-in. | Cause: The server couldn’t extract or map the identity attribute required for Intune MAM (commonly |
| Your account isn't fully set up yet. Please sign in to Mattermost via the web or desktop app first. | The user does not exist in Mattermost for SAML-based sign-in. | Cause: When SAML is the selected provider for Intune MAM enforcement, mobile sign-in cannot create a new user. |
| We couldn't verify your sign in. Please try again. | The access token could not be validated. | Cause: Token validation failed (token malformed, wrong issuer/audience, missing permissions, or Entra configuration mismatch). |
| Your sign in session has expired. Please try signing in again. | The authentication session expired before enrollment completed. | Cause: The access token or interactive session expired during sign-in/enrollment. |
| We couldn't complete your sign in. Please contact your IT administrator. | The access token is missing required claims for sign-in and enrollment. | Cause: Required claims are missing from the MSAL access token (most commonly |
| There was a configuration issue. Please contact your IT administrator. | The token tenant does not match the configured tenant. | Cause: The token was issued by a different tenant than the one configured in Mattermost. |
| AADSTS650057 | The Entra app configuration is missing required permissions and/or admin consent. | Cause: Required Intune MAM API permissions are missing or do not have tenant-wide admin consent. |
| NotLicensed | The server is not licensed for Intune MAM enforcement. | Cause: Enterprise Advanced licensing is missing or not applied to the server. |
| HTTP 403 Forbidden | Server-side access is blocked by a gating condition. | Cause: A server gating condition is preventing enrollment (not an Intune service failure). |
Consent During First Login
If a user’s first mobile sign-in fails with Consent Denied or:
You denied consent for Intune management. The affected accounts have been unenrolled and signed out.
Treat this as missing tenant-wide admin consent for the Entra app registration referenced by Mattermost Server. See the Consent Denied entry in the Intune MAM Errors table above for remediation steps.
To resolve this:
- In the Microsoft Entra admin center, go to Enterprise applications.
- Search for Mattermost Mobile or Mattermost Mobile Beta.
- Go to Permissions and add/grant tenant-wide admin consent for the Intune MAM permissions (for example,
https://msmamservice.api.application/.defaultand Microsoft Mobile Application Management →user_impersonation(Delegated)). - Have the user retry mobile sign-in.
Rollout and Recovery Guidance
- Pilot with a small group first
- Validate identity alignment before broad rollout
- Expect enforcement to occur mid-session if requirements change