Overview#Delegation vs Impersonation has subtle but very important differences.
Typically, when we access a Website we do this in an effort to access Data of some type. Perhaps we need to access data about the news or we go to our Financial Institution to access our bank account. The "news" and our bank account are called Protected Resources. The news may not require Authentication to read the news, but we probably can not change the news without Authentication.
Protected Resources are in many cases use a Data Store (like a database). Typically these Data Stores sit behind a Resource Server. In the case of the news, it could just be a Website with some sort of Content manager. In the bank account databases, these are Database Managers like an Oracle Server.Client Applications" allow us to access some Protected Resource. Like our bank account.
Some of these create a "Password Vault" in which you store your passwords to other sites. Hopefully they protect this "Password Vault" well. Then they replay your password to the other sites to access the Protected Resources. (This is impersonation, not delegation). The Protected Resources thinks it is you accessing the resources and has no idea it is "Client Applications".
One of the biggest violators I know of is Quicken.
Use Case Enterprise LDAP Authentication #Many enterprises use a central LDAP for authentication services. Interestingly, this pattern is similar to the Password Vault Authentication Method. When using LDAP for authentication, a Client Application collects credentials directly from the user (in Plaintext) and then replays these credentials to the LDAP server to determine if they are valid. The Client Application must have access to the plaintext password of the user during the transaction; otherwise, it has no way to perform LDAP Authentication. Use cases, the Client Application is impersonating the Resource Owner (user), and the Protected Resource (our bank account) which has no way of distinguishing a call directly from the Resource Owner from a call being directed through a Client Application. Thus the Protected Resource has no method of Auditing to say otherwise. OAuth 2.0 Token Revocation specification makes specific statements as to Delegation and Impersonation
Delegation semantics are different than impersonation semantics, though the two are closely related. With delegation semantics, principal A still has its own identity separate from B and it is explicitly understood that while B may have delegated some of its rights to A, any actions taken are being taken by A representing B. In a sense, A is an agent for B.
Delegation and impersonation are not inclusive of all situations. When a principal is acting directly on its own behalf, for example, neither delegation nor impersonation are in play. They are, however, the more common semantics operating for token exchange and, as such, are given more direct treatment in OAuth 2.0 Token Revocation.
Delegation semantics are typically expressed in a token by including information about both the primary subject of the token as well as the actor to whom that subject has delegated some of its rights. Such a token is sometimes referred to as a composite token because it is composed of information about multiple subjects. Typically, in the request, the "subject_token" represents the identity of the party on behalf of whom the token is being requested while the "actor_token" represents the identity of the party to whom the access rights of the issued token are being delegated. A composite token issued by the authorization server will contain information about both parties. When and if a composite token is issued is at the discretion of the authorization server and applicable policy and configuration.
These subtle Delegation vs Impersonation become important within Accountable vs responsible discussions.Impersonation flows the original caller's identity to back-end resources on the same computer. Delegation flows the original caller's Digital Identity to back-end resources on computers other than the Service Provider. We call these Resource Servers
For example, if a service is running within IIS without impersonation, the service will access resources using the ASP.NET account in IIS 5.0, or the Network Service account in IIS 6.0. With impersonation, if the client is connecting using the original caller's account, the service will access resources such as a SQL Server database on the same machine using the original caller's Digital Identity instead of the system ASP.NET account.
More Information#There might be more information for this subject on one of the following:
- [#1] - OAuth 2.0 Token Exchange draft-ietf-oauth-token-exchange-07 - based on information obtained 2017-02-20
- [#2] - What is the difference between impersonation and delegation? - based on data observed:2015-05-27