auth0_provider ============== .. py:module:: auth0_provider Classes ------- .. autoapisummary:: auth0_provider.Auth0Provider Module Contents --------------- .. py:class:: Auth0Provider(app, oauth: authlib.integrations.flask_client.OAuth, client_id: str, client_secret: str, domain: str) Bases: :py:obj:`mdvtools.auth.auth_provider.AuthProvider` .. py:method:: _initialize_oauth() Registers the Auth0 OAuth provider and validates OpenID Connect metadata. .. py:method:: login() -> str Initiates the login process by redirecting to Auth0's authorization page. .. py:method:: logout() -> None Logs the user out by clearing the session and redirecting to Auth0's logout endpoint. .. py:method:: get_user(token: dict) -> Optional[dict] Retrieves the user information using the provided token. :param token: Dictionary containing access token and user details :return: User information dictionary or None .. py:method:: get_token() -> Optional[str] Retrieves the token from the session. :return: Token string or None .. py:method:: handle_callback() -> Optional[str] Handles the Auth0 callback and retrieves the access token. :return: Access token string .. py:method:: is_authenticated(token: str) -> bool Checks if the user is authenticated by verifying the token. :param token: Access token :return: True if authenticated, False otherwise .. py:method:: is_token_valid(token) Validates the provided token by verifying its signature using Auth0's public keys and ensuring it's not expired.