ASP.NET Core

SHASHANK MEHTA 1 Reputation point
2021-07-24T08:50:15.297+00:00

I am building a new MVC app using .NET Core 3.1 and will be using Windows Authentication. When I run the code locally (debugging in VS2019) I get the value in User.Identity.Name but when I am hosting the same on Azure App Service I get that as blank.

On Azure Portal under Authentication (classic), I have turned on AppService Authentication and under "Action to take when request is not Authenticated" option I have selected "Login with Azure Active Directory"

Under Authentication Provider: Azure Active Directory is configured.

Under Azure Active Directory the application is registered under App Registration blade. When I access the site after publishing to Azure it asks me to login with my Active directory credentials which is working fine.

Need to understand why I am not able to get the User.Identity.Name, is there anything else that needs to added to the code?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,755 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.