ns12345
ns12345

Reputation: 3105

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?

Upvotes: 1

Views: 1491

Answers (2)

Tridus
Tridus

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

Nima M
Nima M

Reputation: 718

Add a reference to System.Web and use below code:

HttpContext.Current.User.Identity.Name

Upvotes: 2

Related Questions