nat.front_ends.fastapi.auth_flow_handlers.http_flow_handler#

Classes#

HTTPAuthenticationFlowHandler

Handles front-end specific flows for authentication clients.

Module Contents#

class HTTPAuthenticationFlowHandler#

Bases: nat.authentication.interfaces.FlowHandlerBase

Handles front-end specific flows for authentication clients.

Each front end will define a FlowHandler that will implement the authenticate method.

The authenticate method will be stored as the callback in the ContextState.user_auth_callback

abstractmethod authenticate(
config: nat.data_models.authentication.AuthProviderBaseConfig,
method: nat.data_models.authentication.AuthFlowType,
) nat.data_models.authentication.AuthenticatedContext#
Async:

Perform the authentication process for the client.

This method handles the necessary steps to authenticate the client with the target API service, which may include obtaining tokens, refreshing credentials, or completing multistep authentication flows.

Raises:

NotImplementedError: Must be implemented by subclasses.