WCF Impersonation With Client
Software Development February 28th, 2008
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:
- Client Impersonation in WCF
- Azure .NET Services – A Twitter Service Bus
- How to prevent SQL injections
- Astoria DataSource Extender
- DebuggerDisplay Attribute
Tags: WCF
About


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