diff --git a/src/common/Ark.Tools.Auth0/AuthenticationApiClientCachingDecorator.cs b/src/common/Ark.Tools.Auth0/AuthenticationApiClientCachingDecorator.cs index 972215c93..f57abb468 100644 --- a/src/common/Ark.Tools.Auth0/AuthenticationApiClientCachingDecorator.cs +++ b/src/common/Ark.Tools.Auth0/AuthenticationApiClientCachingDecorator.cs @@ -183,6 +183,28 @@ public Task GetTokenAsync(RefreshTokenRequest request, Canc return _getToken(request, _getKey, _inner.GetTokenAsync, cancellationToken); } + /// + /// Exchanges a token using the OAuth 2.0 Token Exchange grant. + /// + /// The token exchange request. + /// The cancellation token to cancel the operation. + /// The requested access token response. + public async Task GetTokenAsync(TokenExchangeTokenRequest request, CancellationToken cancellationToken = default) + { + return await _inner.GetTokenAsync(request, cancellationToken).ConfigureAwait(false); + } + + /// + /// Exchanges an Auth0 token for an access token issued by a federated connection. + /// + /// The federated connection access token request. + /// The cancellation token to cancel the operation. + /// The requested access token response. + public async Task GetTokenAsync(FederatedConnectionAccessTokenRequest request, CancellationToken cancellationToken = default) + { + return await _inner.GetTokenAsync(request, cancellationToken).ConfigureAwait(false); + } + private static string _getKey(RefreshTokenRequest r) { return $"RefreshTokenRequest{r.ClientId}{r.RefreshToken}{r.Audience}{r.Scope}";