Class UmaTicketExchangeClient
- Namespace
- Keycloak.AuthServices.Sdk.Protection
- Assembly
- Keycloak.AuthServices.Sdk.dll
Implements UMA ticket exchange using the Keycloak token endpoint.
public class UmaTicketExchangeClient : IUmaTicketExchangeClient
- Inheritance
-
UmaTicketExchangeClient
- Implements
- Inherited Members
Remarks
Initializes a new instance of the UmaTicketExchangeClient class.
Constructors
UmaTicketExchangeClient(HttpClient, IOptions<KeycloakProtectionClientOptions>, ILogger<UmaTicketExchangeClient>)
Implements UMA ticket exchange using the Keycloak token endpoint.
public UmaTicketExchangeClient(HttpClient httpClient, IOptions<KeycloakProtectionClientOptions> options, ILogger<UmaTicketExchangeClient> logger)
Parameters
httpClientHttpClientoptionsIOptions<KeycloakProtectionClientOptions>loggerILogger<UmaTicketExchangeClient>
Remarks
Initializes a new instance of the UmaTicketExchangeClient class.
Methods
ExchangeTicketForRptAsync(string, string, CancellationToken)
Exchanges a UMA permission ticket for a Requesting Party Token (RPT).
public Task<string?> ExchangeTicketForRptAsync(string accessToken, string ticket, CancellationToken cancellationToken = default)
Parameters
accessTokenstringThe bearer access token of the requesting party.
ticketstringThe permission ticket received from the resource server's UMA challenge.
cancellationTokenCancellationTokenCancellation token.
Returns
SubmitPermissionRequestAsync(string, string, CancellationToken)
Submits a permission request for resource owner approval.
public Task<bool> SubmitPermissionRequestAsync(string accessToken, string ticket, CancellationToken cancellationToken = default)
Parameters
accessTokenstringThe bearer access token of the requesting party.
ticketstringThe permission ticket received from the resource server's UMA challenge.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
Uses the submit_request=true parameter in the UMA ticket exchange.
When access is denied, Keycloak persists a pending permission request that
the resource owner can approve.