I am using IIS 10 with Windows authentication. I can see the windows username in the log files, and i am looking for a way to capture it (after authentication) and using rewrite to store it in a request header Is that possible without too much fuss?
I am using IIS 10 with Windows authentication. I can see the windows username in the log files, and i am looking for a way to capture it (after authentication) and using rewrite to store it in a request header Is that possible without too much fuss?
You can do this with VB or C#, I will give an example of both
VB.NET:
If User.Identity.IsAuthenticated Then
Label1.Text = User.Identity.Name
C#:
if (User.Identity.IsAuthenticated)
Label1.Text = User.Identity.Name;
Hopefully this is what you needed