How can I get the DOMAIN/username in MVC Core once published? I have Identity installed, and realize that for logged-in users
HttpContext.User.Identity.Name
would work but prefer that all users do not need to be logged in. Rather, I would like to use the client box domain/username.
In a local environment, I can do this with:
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
but this doesn't work once published. Once published it renders "IIS APPPOOL/AppName". Is this the expected functionality? If not, how do I fix this?
Most of the information I can find online relates to modifying the web.config file...
The closest I could find is Windows Authentication with asp.net core
but I'm not sure how I would implement in the controller once I follow that