---
locale: "en"
updated_at: "2026-11-26T12:55:46.252Z"
canonical: "https://www.isdecisions.com/en/userlock/docs/guides/configuration/register-microsoft-entra-app-oauth2"
---

# Register a Microsoft Entra app for OAuth2

Microsoft Entra app registration for UserLock OAuth2 email.

## Before you begin

You need this only if UserLock sends email through Microsoft 365 with *Modern authentication (OAuth 2.0)*. It produces the **Application (client) ID** and **Directory (tenant) ID** that you enter in the OAuth2 path of [Configure SMTP settings](/userlock/docs/guides/configuration/configure-smtp-settings#configure-smtp-with-oauth2) Guide.

Make sure you have:

- A Microsoft account with at least the **Application Developer** role on the tenant you will use. Without sufficient permissions, the app registration options are not available.
- Access to the [Microsoft Entra admin center](https://entra.microsoft.com).

## Register the app and create the credentials

You register the app in your own Microsoft Entra tenant. Microsoft owns the console, so each step links to Microsoft's own documentation, which stays current when the interface changes.

1. Register a new application, choosing the **Supported account types** that match who will sign in, following [Register an application](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).
2. On the app's **Overview** page, copy the **Application (client) ID** and the **Directory (tenant) ID**.
3. Add a redirect URI for the **Mobile and desktop applications** platform, and select the suggested URI `https://login.microsoftonline.com/common/oauth2/nativeclient`, following [How to add a redirect URI](https://learn.microsoft.com/en-us/entra/identity-platform/how-to-add-redirect-uri).

> **Note**
>
> UserLock uses a public client (desktop app). Do not create a client secret: for Microsoft, UserLock authenticates with the tenant ID, not a secret.

## Use the credentials in UserLock

Enter the IDs in the UserLock console on the server, as described in the Configure SMTP with OAuth2 section of [Configure SMTP settings](/userlock/docs/guides/configuration/configure-smtp-settings#configure-smtp-with-oauth2) Guide:

1. In **Server**, enter `smtp.office365.com`.
2. In **Authentication**, select **Modern authentication (OAuth 2.0)**.
3. In **Client ID**, enter the Application (client) ID.
4. In **Tenant ID**, enter the Directory (tenant) ID.
5. Click **Sign in** and sign in with the account entered in **From**.
