Skip to main content

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​

  1. In your workspace, go to Authentication > Providers, then click Create Connection.

  2. On the Create Connection page, click the Microsoft Entra ID template.

    The Create Connection page showing identity provider templates, with the Microsoft Entra ID template highlightedThe Create Connection page showing identity provider templates, with the Microsoft Entra ID template highlighted
  3. 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.

  4. 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.
    The Register Microsoft Entra ID form with the Name, Tenant ID, Client ID, Client Secret, and Redirect URL fieldsThe Register Microsoft Entra ID form with the Name, Tenant ID, Client ID, Client Secret, and Redirect URL fields
  5. 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.

SettingDescription
ScopesAdd scopes to request when authenticating to Microsoft Entra ID. SecureAuth requests openid, email, and profile by default.
Authentication Method ReferenceSelect 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 GraphRetrieve additional user attributes through the Microsoft Graph API. Select the Graph User Attributes to return.
Fetch groupsRetrieve 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 IdPSelect 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:

SourceMicrosoft Entra ID source nameSecureAuth target name
Access tokenScopesList of scopes
Access tokenGiven nameGiven name
Access tokenFamily nameFamily name
ID tokenNameName
ID tokenEmailEmail
ID tokenPreferred usernameThe primary username that represents the user
CustomGroupsList 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​

  1. Make sure your Microsoft Entra ID application has the Microsoft Graph permission to read group memberships, as described in Before you begin.

  2. On the Configuration tab of the connection, expand Advanced settings and select Fetch groups.

  3. 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.

  4. Save your changes.

Point the workspace groups claim at Microsoft Entra ID​

  1. Go to Identity > Token Claims and select the ID Tokens tab.

  2. Click the groups row. 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 groups claim is rejected.

  3. Set Type to AuthN Context, and set Source to List of groups that user belongs to.

  4. Click Update.

  5. Leave User info only turned on for the groups row. 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 → Email
  • Given name → First name
  • Family name → Last name
The Provisioning tab with Just-in-Time Provisioning selected, showing Identifier Correlation and Attribute ProvisioningThe Provisioning tab with Just-in-Time Provisioning selected, showing Identifier Correlation and Attribute Provisioning

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 → Email
  • Given name → First name
  • Family name → Last name
The Provisioning tab with Pre provisioning mode selected, showing Authentication flow control, Identifier Correlation, and Attribute ProvisioningThe Provisioning tab with Pre provisioning mode selected, showing Authentication flow control, Identifier Correlation, and Attribute Provisioning

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.

ExtensionDescription
Post Authentication scriptA server-side script that runs after Microsoft Entra ID authentication completes. Click Manage Scripts to configure.
Post Authentication applicationA custom application that receives the user after Microsoft Entra ID authentication completes. Click Manage Custom Apps to configure.

Test the connection​

  1. Confirm the provider is enabled on the Providers list.

  2. Open an application that uses SecureAuth for sign-in, or the built-in User Portal.

  3. Start a sign-in and select the Microsoft Entra ID provider by the name you gave it.

  4. 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.

See also​