Quickstart: Register an application in Microsoft Entra ID
In this quickstart, you learn how to register an application in Microsoft Entra ID. This process is essential for establishing a trust relationship between your application and the Microsoft identity platform. By completing this quickstart, you enable identity and access management (IAM) for your app, allowing it to securely interact with Microsoft services and APIs.
Prerequisites
- An Azure account that has an active subscription. Create an account for free.
- The Azure account must be at least a Application Developer.
- A workforce or external tenant. You can use your Default Directory for this quickstart. If you need an external tenant, complete set up an external tenant.
Register an application
Registering your application in Microsoft Entra establishes a trust relationship between your app and the Microsoft identity platform. The trust is unidirectional. Your app trusts the Microsoft identity platform, and not the other way around. Once created, the application object can't be moved between different tenants.
Follow these steps to create the app registration:
Sign in to the Microsoft Entra admin center as at least an Application Developer.
If you have access to multiple tenants, use the Settings icon
in the top menu to switch to the tenant in which you want to register the application.
Browse to Identity > Applications > App registrations and select New registration.
Enter a meaningful Name for your, for example identity-client-app. App users can see this name, and it can be changed at any time. You can have multiple app registrations with the same name.
Under Supported account types, specify who can use the application. We recommend you select Accounts in this organizational directory only for most applications. Refer to the table below for more information on each option.
Supported account types Description Accounts in this organizational directory only For single-tenant apps for use only by users (or guests) in your tenant. Accounts in any organizational directory For multitenant apps and you want users in any Microsoft Entra tenant to be able to use your application. Ideal for software-as-a-service (SaaS) applications that you intend to provide to multiple organizations. Accounts in any organizational directory and personal Microsoft accounts For multitenant apps that support both organizational and personal Microsoft accounts (for example, Skype, Xbox, Live, Hotmail). Personal Microsoft accounts For apps used only by personal Microsoft accounts (for example, Skype, Xbox, Live, Hotmail). Select Register to complete the app registration.
The application's Overview page is displayed. Record the Application (client) ID, which uniquely identifies your application and is used in your application's code as part of validating the security tokens it receives from the Microsoft identity platform.
Important
New app registrations are hidden to users by default. When you're ready for users to see the app on their My Apps page you can enable it. To enable the app, in the Microsoft Entra admin center navigate to Identity > Applications > Enterprise applications and select the app. Then on the Properties page, set Visible to users? to Yes.
Grant admin consent (external tenants only)
Once you register your application, it gets assigned the User.Read permission. However, for external tenants, the customer users themselves can't consent to this permission. You as the admin must consent to this permission on behalf of all the users in the tenant:
- From the Overview page of your app registration, under Manage select API permissions.
- Select Grant admin consent for < tenant name >, then select Yes.
- Select Refresh, then verify that Granted for < tenant name > appears under Status for the permission.
Add a redirect URI
A redirect URI is where the Microsoft identity platform sends security tokens after authentication. You can configure redirect URIs in Platform configurations in the Microsoft Entra admin center. For Web and Single-page applications, you need to specify a redirect URI manually. For Mobile and desktop platforms, you select from generated redirect URIs. Follow these steps to configure settings based on your target platform or device:
In the Microsoft Entra admin center, in App registrations, select your application.
Under Manage, select Authentication.
Under Platform configurations, select Add a platform.
Under Configure platforms, select the tile for your application type (platform) to configure its settings.
Platform Configuration settings Example Web Enter the Redirect URI for a web app that runs on a server. Front channel logout URLs can also be added Node.js:
•http://localhost:3000/auth/redirect
ASP.NET Core:
•https://localhost:7274/signin-oidc
•https://localhost:7274/signout-callback-oidc
(Front-channel logout URL)
Python:
•http://localhost:3000/getAToken
Single-page application Enter a Redirect URI for client-side apps using JavaScript, Angular, React.js, or Blazor WebAssembly. Front channel logout URLs can also be added JavaScript, React:
•http://localhost:3000
Angular:
•http://localhost:4200/
iOS / macOS Enter the app Bundle ID, which generates a redirect URI for you. Find it in Build Settings or in Xcode in Info.plist.
Workforce tenant:
•com.<yourname>.identitysample.MSALMacOS
External tenant:
•com.microsoft.identitysample.ciam.MSALiOS
Android Enter the app Package name, which generates a redirect URI for you. Find it in the AndroidManifest.xml file. Also generate and enter the Signature hash. Kotlin:
•com.azuresamples.msaldelegatedandroidkotlinsampleapp
.NET MAUI:
•msal{CLIENT_ID}://auth
Java:
•com.azuresamples.msalandroidapp
Mobile and desktop applications Select this platform for desktop apps or mobile apps not using MSAL or a broker. Select a suggested Redirect URI, or specify one or more Custom redirect URIs Embedded browser desktop app:
•https://login.microsoftonline.com/common/oauth2/nativeclient
System browser desktop app:
•http://localhost
Select Configure to complete the platform configuration.
Redirect URI restrictions
There are some restrictions on the format of the redirect URIs you add to an app registration. For details about these restrictions, see Redirect URI (reply URL) restrictions and limitations.
Add credentials
After registering an app, you can add certificates, client secrets (a string), or federated identity credentials as credentials to your confidential client app registration. Credentials allow your application to authenticate as itself, requiring no interaction from a user at runtime, and are used by confidential client applications that access a web API.
Sometimes called a public key, a certificate is the recommended credential type because they're considered more secure than client secrets.
- In the Microsoft Entra admin center, in App registrations, select your application.
- Select Certificates & secrets > Certificates > Upload certificate.
- Select the file you want to upload. It must be one of the following file types: .cer, .pem, .crt.
- Select Add.
In production, you should use a certificate signed by a well known certificate authority (CA) such as Azure Key Vault. For more information about using a certificate as an authentication method in your application, see Microsoft identity platform application authentication certificate credentials.
Next step
After registering an app, you can configure it to expose a web API. To learn how, refer to;