Class AccessTokenRefreshService
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
configIOidcConfigThe OpenID Connect settings.
httpClientFactoryIHttpClientFactoryFactory to create HttpClient instances.
httpClientNamestringOptional name for the HttpClient to use for Open ID Connect related HTTP requests.
clockIClockOptional testable wrapper for system clock.
jwksStoreIJwksStore
Methods
RefreshAsync(TokenResponse)
Refreshes the current token using the refresh token.
public Task<TokenResponse?> RefreshAsync(TokenResponse currentToken)
Parameters
currentTokenTokenResponseCurrent token from previous authentication.
Returns
- Task<TokenResponse>
A new token.
Exceptions
- ArgumentNullException
currentTokenwasnull.