How to get windows user id in Forms Authentication
Hi,
I use forms authentication in my application. One reason is troubleshooting and impersonating purposes for production support. In forms authentication we can log in as a differnet user as long as we know their credentials.If I use windows authentication, I won't be able to get the view of a different person's as I can't login as him/her.
Is there a way I can get the windows login id of the user while using forms authentication.
I have a small windows authenticated application where I use the following code to get the logged in windows user id. But I don't think that will give proper results with forms authentication.
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
strDUserName = wp.Identity.Name;
Thanks in advance.
|