Set up Microsoft Entra ID for authentication with OIDC
Users in your Microsoft Entra ID (formerly Azure Active Directory) tenant can access applications registered in SecureAuth. In this setup, Microsoft Entra ID acts as an external identity provider (IdP): your users sign in with the Microsoft Entra ID accounts they already have. This guide is for administrators connecting a Microsoft Entra ID tenant to a SecureAuth Connect workspace.
How the integration works
SecureAuth supports Microsoft Entra ID as an OpenID Connect (OIDC) identity provider and provides a dedicated connection template for it. Microsoft Entra ID issues an ID token and an access token that identify the user to SecureAuth.
When a user signs in, SecureAuth brokers the exchange between the application and Microsoft Entra ID. It redirects the user to Microsoft Entra ID, collects the tokens that come back, and issues its own tokens to the application. The diagram below shows the full flow.
Two parts of the flow are optional:
- SecureAuth pulls user attributes and group membership only when you enable those options on the connector.
- SecureAuth asks the user for consent only when an untrusted application requests scopes the user has not already approved.
Microsoft Entra ID and SAML
This template uses OIDC. Microsoft Entra ID applications can also use SAML, but SecureAuth has no dedicated SAML template for Microsoft Entra ID. To connect over SAML, use the generic SAML connector.
Before you begin
Register an application in your Microsoft Entra ID tenant for SecureAuth to connect to. Follow the Microsoft Entra app registration guide. You need the directory (tenant) ID, the application (client) ID, and a client secret.
Leave the redirect URI empty for now. SecureAuth generates a redirect URL during connection setup that you add to the app registration afterward.
To let SecureAuth fetch user attributes or group membership, grant your application the matching Microsoft Graph permissions. For details, see the Microsoft Graph documentation for Get a user and List group memberships.
Connect Microsoft Entra ID to SecureAuth
Create the connection
-
In your workspace, go to Authentication > Providers, then click Create Connection.
-
On the Create Connection page, click the Microsoft Entra ID template.


-
Copy the Redirect URL from the form and add it as a redirect URI on your Microsoft Entra ID app registration. This lets Microsoft Entra ID return the user to SecureAuth after authentication.
-
Complete the remaining fields:
- Name – Enter a name that helps users recognize this provider on the sign-in page.
- Tenant ID – Enter the directory (tenant) ID of your Microsoft Entra ID tenant.
- Client ID – Enter the application (client) ID of your registered application.
- Client Secret – Enter the client secret value for the application. Copy this value from Microsoft Entra ID as soon as you create it, because it cannot be retrieved later.


-
Save your changes.
The connection appears on the Providers list. Open it to reach the configuration tabs described in the following sections.
Configure advanced settings
Advanced settings are optional and apply to specific scenarios. On the connection's Configuration tab, expand Advanced settings.
| Setting | Description |
|---|---|
| Scopes | Add scopes to request when authenticating to Microsoft Entra ID. SecureAuth requests openid, email, and profile by default. |
| Authentication Method Reference | Select an authentication method to write into the amr claim returned by the provider. The selected value replaces any existing amr value. |
| Fetch user attributes from Azure Graph | Retrieve additional user attributes through the Microsoft Graph API. Select the Graph User Attributes to return. |
| Fetch groups | Retrieve the groups a user belongs to. Select Only security groups to limit results to security groups, and set Group name format to return groups by ID or name. |
| Parameters forwarded to IdP | Select which parameters from the original sign-in request SecureAuth passes on to Microsoft Entra ID: login_hint, prompt, max_age, or id_token_hint. Forward login_hint so the user does not have to enter their identifier again. |
The Configuration tab also has a Token Exchange section, which issues SecureAuth tokens in exchange for tokens from this provider. For more information, see Token exchange.
Attributes
The Attributes tab lists the claims Microsoft Entra ID returns after authentication. SecureAuth recognizes a standard set of claims by default, sourced from the access token, including token claims such as aud, iss, iat, exp, and appid.
To add a custom claim that your tenant returns, click + Add attribute and set its Claim name, Display name, Data type, and Source. The source can be the access token, the ID token, or Azure Graph. Azure Graph is available only when Fetch user attributes from Azure Graph is turned on in advanced settings.
Mappings
Mapping connects the claims from Microsoft Entra ID to the SecureAuth authentication context, so every provider feeds a consistent set of user data to your applications. These default mappings apply out of the box:
| Source | Microsoft Entra ID source name | SecureAuth target name |
|---|---|---|
| Access token | Scopes | List of scopes |
| Access token | Given name | Given name |
| Access token | Family name | Family name |
| ID token | Name | Name |
| ID token | ||
| ID token | Preferred username | The primary username that represents the user |
| Custom | Groups | List of groups that user belongs to |
To customize, click + Add mapping or + Add static mapping, then click Save mappings.
Use Microsoft Entra ID groups in Agent Authority policies
Skip this section unless you use an Agentic AI workspace with SecureAuth Agent Authority.
The groups mapping above puts the groups from Microsoft Entra ID in the authentication context, but Agent Authority does not read them from there. It reads the groups claim of your workspace, and that claim gets its groups from the identity pool by default. To use the groups from Microsoft Entra ID, have SecureAuth fetch them, then point the claim at the authentication context.
Fetch groups from Microsoft Entra ID
-
Make sure your Microsoft Entra ID application has the Microsoft Graph permission to read group memberships, as described in Before you begin.
-
On the Configuration tab of the connection, expand Advanced settings and select Fetch groups.
-
Set Group name format to the format your policies use. Name returns group names, and ID returns group object IDs. A policy condition matches only if it uses the same format.
-
Save your changes.
Point the workspace groups claim at Microsoft Entra ID
-
Go to Identity > Token Claims and select the ID Tokens tab.
-
Click the
groupsrow. Its Type is User, which means it reads groups from the identity pool.Edit this claim rather than adding a new one. Claim names must be unique, so a second
groupsclaim is rejected. -
Set Type to AuthN Context, and set Source to List of groups that user belongs to.
-
Click Update.
-
Leave User info only turned on for the
groupsrow. This keeps groups out of the ID token while still returning them in the user info response, where Agent Authority reads them.
A claim has one source, and this change applies to every application and sign-in method in the workspace, not just this Microsoft Entra ID connection. The groups claim now uses the current sign-in's authentication context: Microsoft Entra ID sign-ins supply Microsoft Entra ID groups, while other providers supply their mapped groups, if any. Identity-pool memberships are no longer released through this claim. Before changing it, check whether other applications or sign-in methods depend on identity-pool groups.
Check that groups arrive
Sign in through Microsoft Entra ID as a user who belongs to a Microsoft Entra ID group. Then open the Users page in Agent Authority and confirm that the group appears in the Groups column for that user. If it doesn't appear yet, read When a group change takes effect.
Provisioning
Provisioning controls what happens to a user account when someone authenticates through Microsoft Entra ID. Select a mode on the Provisioning tab.
Disabled
SecureAuth does not save users to the user store. Authentication still succeeds.
Just-in-time provisioning
SecureAuth saves each user to the user store the first time they sign in.
Identifier Correlation
Matches the incoming Microsoft Entra ID identity to an existing user. Default: Microsoft Entra ID Email ↔ Users Email.
Attribute Provisioning
Maps Microsoft Entra ID attributes to user profile fields. Defaults:
Email→EmailGiven name→First nameFamily name→Last name


Pre provisioning mode
SecureAuth does not create users at sign-in. You add them ahead of time through an offline process.
Authentication flow control
Sets what happens when no matching user is found:
- Deny – End the authentication flow.
- Allow – Proceed with the authentication flow.
Identifier Correlation
Matches the incoming Microsoft Entra ID identity to an existing user. Default: Microsoft Entra ID Email ↔ Users Email.
Attribute Provisioning
Maps Microsoft Entra ID attributes to user profile fields. Defaults:
Email→EmailGiven name→First nameFamily name→Last name


Extensions
Extensions run custom logic after a user authenticates with Microsoft Entra ID, such as enriching the authentication context or routing the user through an extra step. Configure them on the Extensions tab.
| Extension | Description |
|---|---|
| Post Authentication script | A server-side script that runs after Microsoft Entra ID authentication completes. Click Manage Scripts to configure. |
| Post Authentication application | A custom application that receives the user after Microsoft Entra ID authentication completes. Click Manage Custom Apps to configure. |
Test the connection
-
Confirm the provider is enabled on the Providers list.
-
Open an application that uses SecureAuth for sign-in, or the built-in User Portal.
-
Start a sign-in and select the Microsoft Entra ID provider by the name you gave it.
-
Authenticate with a Microsoft Entra ID account. If the application is not trusted, SecureAuth shows a consent page listing the data shared with the application. After the user allows access, SecureAuth issues its tokens with the user data mapped from Microsoft Entra ID.