Showing posts with label WindowsIdentity. Show all posts
Showing posts with label WindowsIdentity. Show all posts
Wednesday, April 7, 2010
Get Windows Username in WCF service method
For configuring windows authentication in WCF service, please refer my previous blog Windows Authentication in WCF
In some scenario, we need to find out the user name who calls WCF service method. You can find out current logged in user who called WCF service method using below code:
OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name
The above property will return logged in user name with domain name. For example, it returns “DOMAIN\USER”.
Labels:
OperationContext,
Username,
WCF,
Windows Authentication,
WindowsIdentity
Subscribe to:
Posts (Atom)
