Client username/windowsIdentity from web service
How can I fetch client's WindowsIdentity from 开发者_开发技巧web service without impersonating?
What are the advantages and disadvantages of impersonation?
Add a reference to System.Web and use below code:
HttpContext.Current.User.Identity.Name
Impersonation lets a service call something else while acting as the user who called the service. To just get the identity of the user calling the service, you don't need impersonation (but you do need authentication enabled).
精彩评论