Difference between Impersonation and Delegation in WCF?
Impersonation is used to access the resources when the resources are on the same machine as the service. Delegation is used to access the resources that are remotely hosted.
There are two types of Impersonation in WCF
Imperative Impersonation – Perform programmatically at run time
Declarative Impersonation – Applied with a static attribute which associated with an operation.
Use Impersonation when
You want to access windows resources that are protected with access control lists(ACL’s).
You need to use specific identity or several windows identities to access resources.
Use Delegation when
You need to access network resources.
Declarative Impersonation
[OperationBehavior(Impersonation = ImpersonationOption.Required)]
public string GetData(int value)
{
return “test”;
}
Read more: Techbubles
QR: