If you have a service that uses Windows authentication and you want to impersonate the caller you need to configure the client and the server.

This is the client proxy. You need to give it the correct credentials.

client.ClientCredentials.Windows.ClientCredential.Domain = "DOMAINName";client.ClientCredentials.Windows.ClientCredential.UserName = "UserName";client.ClientCredentials.Windows.ClientCredential.Password = "Password";client.ClientCredentials.Windows.AllowedImpersonationLevel =   System.Security.Principal.TokenImpersonationLevel.Impersonation;

The server side looks like this:

using (ServiceSecurityContext.Current.WindowsIdentity.Impersonate()){...}

This impersonate part of the method. This property impersonate all method:

[OperationBehavior(Impersonation = ImpersonationOption.Required)]

Similar Posts:

Tags:



One Comment to “WCF Impersonation With Client”

  1. maord | June 22nd, 2009 at 23:08

    This comment originally written by:
    If you have a service that uses Windows authentication and you want to impersonate the caller, you need to configure the client and the server. This is the client proxy. You need to give it the correct credentials. client.ClientCredentials.Windows.ClientCredential

Leave a Comment