aka baka
aka baka

Reputation: 223

How to Authenticate Azure AD users?

I want to authenticate the Active AD users in my application. Only authorized users should be able to login. My application components are

  1. Web Page (Client)
  2. Net Core API 6.0
  3. Azure AD.

The Azure AD login credentials will be entered through the web client. Please let me know if the following is the correct way to do the authentication.

Get the Token by connecting to Azure AD through the web client. Send the token to web API for validation.

Thanks for your valuable suggestions.

Upvotes: 4

Views: 1764

Answers (1)

Harshitha
Harshitha

Reputation: 7402

  • We have reproduced authenticating AD Users in our environment, please check the below workaround.

  • Created .Net Core WebAPI 6.0 sample application, Published to Azure App Service.

  • In Azure Portal, navigate to your web app => Authentication => Add provider under Identity provider. enter image description here

Click on Add Identity Provider, select Microsoft as an Identity Provider and Save.enter image description here

  • After adding Identity provider, Navigate to Azure Active Directory, in App registrations section, check in the All applications- you can see the new app registration is available with the same name of your Web App.
  • If it is not available add New Registration, click on Authentication => Add a platform => Select Web and Add the Redirect URI.

enter image description here

Redirect URI - https://YourWebAppName.azurewebsites.net/.auth/login/aad/callback

  • Try to access the published App, It will be navigated to the Microsoft Page.Once after authenticating the user it will be redirected to your WebApp.

enter image description here

OutPut : enter image description here

enter image description here

References taken from : Configure App Service to use Azure AD login

Upvotes: 2

Related Questions