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
Description
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:
- A
USER_A
accessesCLIENT_A
and retrieves an Access TokenAT1
with a set of scopes that includes theoffline_scope
. CLIENT_A
sendsAT1
toCLIENT_B
.- Then
CLIENT_B
exchangesAT1
with a new Refresh TokenRT1
with the same scope set, but sets theaudience
parameter of the request to beCLIENT_C
andCLIENT_D
. - Finally
CLIENT_B
,CLIENT_C
orCLIENT_D
may useRT1
to get Access TokenAT2
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 sessionUSER_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 forCLIENT_B
to be able to use it. This in terms of oidc-op is interpreted as a new sessionUSER_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 thatRT1
is mapped to and checks if theclient_id
stated in the request matches the client of the session. This check should be modified in order to include a check upon theaudience
of the used token. - In RFC-8693 there is no strict definition of what the
audience
(or evenresource
) parameter should represent. For now, we intend to map theaudience
parameter with oidc-opclient_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
Labels
No labels