RefreshingOAuthToken

fun ClientFilters.RefreshingOAuthToken(config: OAuthProviderConfig, backend: HttpHandler, gracePeriod: Duration = Duration.ofSeconds(10), clock: Clock = Clock.systemUTC(), scopes: List<String> = emptyList(), resourceUri: Uri? = null): Filter(source)

Obtains and refreshes OAuth tokens using the standard client_credentials grant from the provider config. Suitable for machine-to-machine scenarios with a client ID and secret.


fun ClientFilters.RefreshingOAuthToken(clientCredentials: Credentials, tokenUri: Uri, backend: HttpHandler, gracePeriod: Duration = Duration.ofSeconds(10), clock: Clock = Clock.systemUTC(), scopes: List<String> = emptyList(), resourceUri: Uri? = null): Filter(source)

Obtains and refreshes OAuth tokens using the standard client_credentials grant. Suitable for machine-to-machine scenarios with a client ID and secret.


fun ClientFilters.RefreshingOAuthToken(clientCredentials: Credentials, tokenUri: Uri, backend: HttpHandler, oAuthFlowFilter: Filter, gracePeriod: Duration = Duration.ofSeconds(10), clock: Clock = Clock.systemUTC(), tokenExtractor: AccessTokenExtractor = ContentTypeJsonOrForm(), scopes: List<String> = emptyList(), resourceUri: Uri? = null): Filter(source)

Obtains and refreshes OAuth tokens with a custom initial grant flow but standard client_credentials-based refresh. Use when the initial grant is non-standard but the client has credentials for refreshing tokens.


fun ClientFilters.RefreshingOAuthToken(tokenUri: Uri, backend: HttpHandler, oAuthFlowFilter: Filter, oAuthRefreshFilter: (RefreshToken) -> Filter, gracePeriod: Duration = Duration.ofSeconds(10), clock: Clock = Clock.systemUTC(), tokenExtractor: AccessTokenExtractor = ContentTypeJsonOrForm()): Filter(source)

Obtains and refreshes OAuth tokens with fully pluggable grant and refresh flows. Use for scenarios where neither the initial grant nor refresh use client credentials (e.g. JWT assertions, ID-JAG).