HttpContextAccessor not returning logged in Windows User ID in ASP.NET MVC, what can be done?

17 Views Asked by At

How can you get the current logged in Windows user id using HttpContextAccessor in ASP.NET MVC controller?

I tried to use HttpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.NameIdentifier) but doesn't return the User ID of the current logged in user.

0

There are 0 best solutions below