Table of Contents

Class AccessTokenRefreshService

Namespace
Tenduke.Core.Auth
Assembly
Tenduke.Core.dll

Default implementation of IAccessTokenRefreshService.

public class AccessTokenRefreshService : IAccessTokenRefreshService
Inheritance
AccessTokenRefreshService
Implements
Inherited Members

Constructors

AccessTokenRefreshService(IOidcConfig, IHttpClientFactory, string?, IClock?, IJwksStore)

Initializes a new instance of the class.

public AccessTokenRefreshService(IOidcConfig config, IHttpClientFactory httpClientFactory, string? httpClientName, IClock? clock, IJwksStore jwksStore)

Parameters

config IOidcConfig

The OpenID Connect settings.

httpClientFactory IHttpClientFactory

Factory to create HttpClient instances.

httpClientName string

Optional name for the HttpClient to use for Open ID Connect related HTTP requests.

clock IClock

Optional testable wrapper for system clock.

jwksStore IJwksStore

Methods

RefreshAsync(TokenResponse)

Refreshes the current token using the refresh token.

public Task<TokenResponse?> RefreshAsync(TokenResponse currentToken)

Parameters

currentToken TokenResponse

Current token from previous authentication.

Returns

Task<TokenResponse>

A new token.

Exceptions

ArgumentNullException

currentToken was null.