Implement "actor token" feature in token exchange according to the RFC.
If actor_token is present, will add an extra claim act to the response access token.
Because the class AccessToken can only accept a list of predefined claims, so we have to set the act claim to extra first, and then extract it to the outside in extraTokenClaims option of node-oidc-provider.
This PR also includes the refactor of token-exchange.ts, it is now splited into a folder of files.
Summary
Implement "actor token" feature in token exchange according to the RFC.
If
actor_token
is present, will add an extra claimact
to the response access token.Because the class
AccessToken
can only accept a list of predefined claims, so we have to set theact
claim toextra
first, and then extract it to the outside inextraTokenClaims
option ofnode-oidc-provider
.This PR also includes the refactor of
token-exchange.ts
, it is now splited into a folder of files.Testing
Unit and integration tests.
Checklist
.changeset