Posts

Showing posts from January 8, 2019

.Net Core 2.1 getting client machines windows user name

Image
1 I am attempting to get the currently logged in user in Windows on the clients computer. I have tried using User.Identity.Name & WindowsIdentity.GetCurrent().Name. When I run the application locally through Visual Studio, it runs great. Meanwhile when I publish this same code to our IIS server when I run the this code, it returns "NT AUTHORITYNETWORK SERVICE". I thought this was going to be an easier task and started going through a bunch of different google searches with no luck (maybe its just that im new to .net core and am making a dumb mistake somewhere). Anyhow my server has Windows Authorization enabled (see image below). The project is a .net core 2.1 web application and I am working in C#. Any help with this would be great! Note My previous thread (now deleted) for this question was mark