mdvtools.auth.auth_provider#

Classes#

AuthProvider

Helper class that provides a standard way to create an ABC using

Module Contents#

class mdvtools.auth.auth_provider.AuthProvider[source]#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstractmethod login() flask.typing.ResponseReturnValue[source]#

Redirects to the login page of the provider.

abstractmethod logout() flask.typing.ResponseReturnValue[source]#

Logs out the user.

abstractmethod get_user(token: dict | None = None) dict | None[source]#

Fetches the user profile using the provided token.

abstractmethod get_token() str | None[source]#

Gets the current user’s access token.

abstractmethod handle_callback() str | None[source]#

Handles the callback and exchanges the code for a token (implemented by the provider).

Returns:

Access token if successfully retrieved, else None

abstractmethod validate_user() Tuple[dict | None, Tuple | None][source]#

Validates and returns user data.

abstractmethod sync_users_to_db()[source]#

Syncs users from the authentication provider (e.g., Auth0) to the application’s database.