Table of Contents

Interface IAuthenticationHandler

Namespace
Apizr.Authenticating
Assembly
Apizr.dll

The authentication handler definition

public interface IAuthenticationHandler

Methods

GetTokenAsync(HttpRequestMessage, CancellationToken)

The method called to get local token

Task<string> GetTokenAsync(HttpRequestMessage request, CancellationToken ct = default)

Parameters

request HttpRequestMessage

The request to authenticate

ct CancellationToken

The cancellation token

Returns

Task<string>

The saved token

RefreshTokenAsync(HttpRequestMessage, string, CancellationToken)

The method called to refresh token when rejected or empty

Task<string> RefreshTokenAsync(HttpRequestMessage request, string token, CancellationToken ct = default)

Parameters

request HttpRequestMessage

The request to authenticate

token string

The former token

ct CancellationToken

The cancellation token

Returns

Task<string>

The refreshed token

SetTokenAsync(HttpRequestMessage, string, CancellationToken)

The method called to set local token

Task SetTokenAsync(HttpRequestMessage request, string token, CancellationToken ct = default)

Parameters

request HttpRequestMessage

The request to authenticate

token string

The token to save

ct CancellationToken

The cancellation token

Returns

Task