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-Token-Exchange specification makes specific statements as to Delegation and Impersonation
With impersonation principal A impersonates principal B, principal A is given all the rights that principal B has within some defined rights context and is indistinguishable from principal B in that context. Thus, when principal A impersonates principal B, then in so far as any entity receiving such a Token is concerned, they are actually dealing with principal B.
It is true that some members of the identity system might have awareness that impersonation is going on, but it is not a requirement. For all intents and purposes, when principal A is impersonating principal B, principal A is principal B.
With delegation semantics, principal A still has its own identity separate from principal B's identity and it is explicitly understood that while principal B may have delegated some of its rights to principal A, any actions taken are being taken by principal A representing principal B. In a sense, principal A is an agent for principal B.
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