auth_provider

Classes

AuthProvider

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

Module Contents

class auth_provider.AuthProvider[source]

Bases: abc.ABC

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

abstractmethod login() str[source]

Redirects to the login page of the provider.

abstractmethod logout() None[source]

Logs out the user.

abstractmethod get_user(token: dict) 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 is_authenticated(token: str) bool[source]

Verifies if the user is authenticated using the token.