IHttpAuthenticationProvider

The IHttpAuthenticationProvider interface defines methods for adding authentication details to HTTP requests when interacting with the Jinaga replicator. It is used to ensure that all HTTP requests made by the JinagaClient are properly authenticated.

Methods

SetRequestHeaders

void SetRequestHeaders(HttpRequestHeaders headers)

Adds the authentication token to the HTTP request headers.

Parameters:

  • headers: The HttpRequestHeaders to modify with authentication details.

Description:

This method is called before sending an HTTP request to ensure that the request is authenticated. The token or other credentials are added to the provided headers.

Reauthenticate

Task<bool> Reauthenticate()

Attempts to reauthenticate the user when a request fails with a 401 Unauthorized status.

Returns:

  • Task<bool>: Returns true if the authentication token was successfully refreshed, otherwise false.

Description:

This method is invoked after an authentication failure (e.g., 401 Unauthorized) to attempt to refresh or renew the authentication token. If the reauthentication is successful, the request can be retried.

Continue With

JinagaStatus

Jinaga is a product of Jinaga LLC.

Michael L Perry, President