TokenEndpointTransport

Carries the OAuth requests that authenticate the client — the pushed authorization request, the authorization-code exchange, the refresh, and the revocation — to the authorization server and brings its answer back.

The default, DirectTokenEndpointTransport, posts straight to the server, which is all a public client needs. A confidential client supplies its own transport that sends the request through a backend holding the client's signing key (a "token-mediating backend"); the backend adds the client assertion and relays the server's response. XRPC calls never go through a transport.

The DPoP proof in a request is always made for the authorization server's own endpoint (TokenEndpointRequest.endpointUrl). A transport that relays must forward it unchanged.

Failures

Throw TokenRequestNotSentException when the request provably never left (so nothing single-use was spent). Any other exception is treated as an unknown outcome: the server may have acted on the request.

Inheritors

Properties

Link copied to clipboard

Whether a refresh sent through this transport can end with an unknown outcome that a different route must not retry.

Functions

Link copied to clipboard
abstract suspend fun send(request: TokenEndpointRequest): TokenEndpointResponse