In ASP.NET or WCF is it safe to use ServiceSecurityContext.Current.WindowsIdentity.Nameto get the current username that 开发者_JS百科executes the current thread?
I want to ensure that the correct user is impersonated in my WCF Service.
WindowsIdentity.GetCurrent().Name
is probably a better alternative, as I don't think that ServiceSecurityContext.Current is available in ASP.NET.
You may also want to consider
Thread.CurrentPrincipal.Identity.Name
if you care about the user instead of the process identity.
加载中,请稍侯......
精彩评论