You can use Microsoft Entra ID SSO to authenticate your apps instead of or in addition to built in local accounts. Currently in order for Microsoft Entra ID SSO to work, a local account record needs to be explicitly created for each user. This means that a user must register or be created by an administrator prior to being able to gain access to the app. THIS IS BY DESIGN. In the future, an option will be created to allow for the local account record to be automatically generated at first login.
Prerequisite: You will need to create a new Azure account with Microsoft to do this.
-
Log into https://portal.azure.com with your Azure credentials.
-
Navigate to the Microsoft Entra ID area in the Azure portal.
-
On the left navigation menu, expand the "Manage" menu and then select App Registrations.
-
Click the Register an Application button.
-
Enter your application information:
- Name - The name of your application. For this example, we will use "My Test Application".
- Support account types - This documentation only officially supports "Single tenant" applications, but this could change.
- Redirect URI - Select
Webas the platform and enterhttp://localhost:4200/account/microsoft-login-callback.
-
Click the "Register" button to continue.
-
Navigate back to the App Registrations area. You will see a list of application owned by you. You many have to click the "All Applications" tab to see your newly registered "My Test Application" (or whatever you named it). Click on it for more details and you will see the following overview screen. Take note of the following details: "Application (client) ID" and "Directory (tenant) ID".
-
Under the "Client credentials" section of the overview page, click the "Add a certificate or secret" link.
-
Click the "New client secret" button. Enter info for the following fields:
- Description - For this example I'm entering "My Test Application Client Secret".
- Expires - Recommended is 180 days. You will need to add to your calendar a reminder to rotate this secret before the selected expiration period expires.
-
Take note of the new value of the client secret in the "Value" column of the table you see on the resulting "Certificates & secrets" page.
At this point, you should have everything set up that you need to authenticate with Azure in your local application.
-
Open your API's [App Settings] file located in
WebApi\WebApi\appsettings.json -
In the
AppConfigsection of the file make the following changes:- Set the
EnableMicrosoftSsovalue totrue. - Set the
MicrosoftTenantIdvalue to the "Directory (tenant) ID" value noted when registering an application. - Set the
MicrosoftClientIdvalue to the "Application (client) ID" value noted when registering an application.
- Set the
-
In the
AuthSettingssection of the file:- Set the
MicrosoftClientSecretvalue to the value noted on the "Certificates & secrets" page in the Azure Portal.
- Set the
This should be all that is needed to allow for your application to authenticate with Microsoft Entra ID.

