Language

HubConnection.RefreshAuthenticationAsync(CancellationToken) Method

Definition

Sends a POST to the server's /refresh endpoint to refresh the authentication token. The server re-authenticates and updates the connection's ClaimsPrincipal. Returns the updated token lifetime, or null if not provided.

public System.Threading.Tasks.Task<TimeSpan?> RefreshAuthenticationAsync(System.Threading.CancellationToken cancellationToken = default);
member this.RefreshAuthenticationAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<TimeSpan>>
Public Function RefreshAuthenticationAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(Of TimeSpan))

Parameters

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

The new token lifetime from the server, or null.

Applies to