Reputation: 3105
How can I fetch client's WindowsIdentity from web service without impersonating?
What are the advantages and disadvantages of impersonation?
Upvotes: 1
Views: 1491
Reputation: 5081
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).
Upvotes: 0
Reputation: 718
Add a reference to System.Web and use below code:
HttpContext.Current.User.Identity.Name
Upvotes: 2