Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Token Exchange support #162

Open
Open
@ctriant

Description

@ctriant

So, we are in the process of adding Token Exchange support on oidc-op as described in RFC-8693 and we need feedback regarding the implementation.

More specifically, we consider the following scenario regarding the exchanging of Access Tokens with Refresh Tokens:

  1. A USER_A accesses CLIENT_A and retrieves an Access Token AT1 with a set of scopes that includes the offline_scope.
  2. CLIENT_A sends AT1 to CLIENT_B.
  3. Then CLIENT_B exchanges AT1 with a new Refresh Token RT1 with the same scope set, but sets the audience parameter of the request to be CLIENT_C and CLIENT_D.
  4. Finally CLIENT_B, CLIENT_C or CLIENT_D may use RT1 to get Access Token AT2 with the same or fewer scopes (and optionally with a different audience) to access protected resource X. Equivalently, AT2 will be owned by the client that issued the new Token Exchange request and every client (if any) that will be stated in the audience parameter will be allowed to use it.

Some observations on the aforementioned scenario:

  • During step 1, the initial access token AT1 belongs to a session USER_A;;CLIENT_A in terms of oidc-op.
  • On the contrary, at step 3 the exchanged refresh token RT1 should be mapped in a different client in order for CLIENT_B to be able to use it. This in terms of oidc-op is interpreted as a new session USER_A;;CLIENT_B where the token should be assigned.
  • In step 4, only the owner and the corresponding audience of token RT1 are allowed to use it. Currently, oidc-op retrieves the session that RT1 is mapped to and checks if the client_id stated in the request matches the client of the session. This check should be modified in order to include a check upon the audience of the used token.
  • In RFC-8693 there is no strict definition of what the audience (or even resource ) parameter should represent. For now, we intend to map the audience parameter with oidc-op client_id.

Some potential conflicts in case of multiple audiences:

  • What happens if we decide to support revocation of token upon usage? The first client, out of the set of the legitimate clients that are allowed to use the token, restricts the others from using it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions