Can i get the requester windows IPrincipal when he comsume WCF service?
+4
A:
Using this code, you can examine the current security context inside your WCF service. If the user is authenticated, and the WindowsPrincipal is not null, then you're using a Windows security model - you can access all the relevant info:
ServiceSecurityContext current = ServiceSecurityContext.Current;
if (!current.IsAnonymous)
{
if (current.WindowsIdentity != null)
{
string userName = current.WindowsIdentity.Name;
}
}
Marc
marc_s
2009-06-14 15:42:14
thanx a lot!i disable to mark this as answer somehow.Thank you anyway.Tamir
Tamir
2009-06-14 16:52:46
Just what I needed
TWith2Sugars
2010-10-13 11:25:11