Signals from AdminAuth
The lback.auth.admin_auth.AdminAuth class, which specifically handles authentication and authorization for admin users, emits signals at various critical points throughout its operations. These signals are incredibly useful for auditing admin actions, integrating with logging or monitoring systems, or implementing custom security logic related to admin user management.
Signal Name |
Description |
Arguments (kwargs) |
|---|---|---|
|
Emitted immediately after the |
|
|
Emitted just before an attempt is made to register a new admin user. |
|
|
Emitted when a new admin user has been successfully registered (i.e., added to the database). |
|
|
Emitted when an attempt to register an admin user fails. |
|
|
Emitted just before an attempt is made to log in an admin user. |
|
|
Emitted when an admin user has successfully authenticated and their session has been initiated. |
|
|
Emitted when an attempt to log in an admin user fails (e.g., due to invalid credentials or an internal error). |
|
|
Emitted just before an admin user’s session is terminated as part of a logout process. |
|
|
Emitted when an admin user’s session has been successfully ended (deleted). |
|
|
Emitted after an attempt to verify if an admin user is currently logged in via their session. |
|
Signals from JWTAuth
The lback.auth.jwt_auth.JWTAuth class, which provides utilities for creating, decoding, and validating JSON Web Tokens (JWTs), emits signals at various stages of token lifecycle and validation. These signals are highly valuable for auditing token issuance, monitoring authentication attempts, and integrating with security logging systems.
Signal Name |
Description |
Arguments (kwargs) |
|---|---|---|
|
Emitted when a new access token has been successfully created. |
|
|
Emitted when a new refresh token has been successfully created. |
|
|
Emitted when a JWT token has been successfully decoded and its signature and expiration verified. |
|
|
Emitted when a JWT token fails to decode or validate due to various reasons (e.g., expired, invalid signature, malformed). |
|
Signals from OAuth2Auth
The lback.auth.oauth2_auth.OAuth2Auth class is a crucial utility for handling interactions with an OAuth2 provider, specifically implementing the Authorization Code Grant flow. This class emits signals at key stages of the OAuth2 process, providing invaluable insights for monitoring authentication flows, debugging integrations, and auditing user consent and token management.
Signal Name |
Description |
Arguments (kwargs) |
|---|---|---|
|
Emitted right after the full authorization URL has been constructed and is ready to be used for redirecting the user to the OAuth2 provider. |
|
|
Emitted when an authorization code has been successfully exchanged for an access token (and potentially a refresh token) from the OAuth2 provider. |
|
|
Emitted when the attempt to exchange an authorization code for a token fails due to network issues, invalid code, or provider errors. |
|
|
Emitted when a refresh token has been successfully used to obtain a new access token (and optionally a new refresh token). |
|
|
Emitted when the attempt to refresh a token fails, possibly due to an expired or invalid refresh token, or provider errors. |
|
Signals from PermissionRequired
The lback.auth.decorators.PermissionRequired decorator plays a crucial role in securing views by enforcing granular permission checks. This class emits signals at key stages of the permission evaluation process, offering valuable hooks for auditing access attempts, integrating with security logging systems, or implementing custom response logic based on access outcomes.
Signal Name |
Description |
Arguments (kwargs) |
|---|---|---|
|
Emitted at the very beginning of the permission check process for a decorated view. |
|
|
Emitted when the authenticated user successfully passes all required permission checks for a view. |
|
|
Emitted when the authenticated user (or lack thereof) fails to meet the required permissions for a view. |
|
Signals from SessionAuth
The lback.auth.session_auth.SessionAuth utility is central to managing user authentication via sessions. It provides a robust way to track user login states and session lifecycle. This class emits signals at critical points during user login, logout, and session status checks, enabling detailed auditing, real-time monitoring of user activity, and integration with other security or logging mechanisms.
Signal Name |
Description |
Arguments (kwargs) |
|---|---|---|
|
Emitted when a user is successfully logged in and their user_id and user_type have been set in an active session. |
|
|
Emitted when an attempt to log a user in via session fails (e.g., due to an unavailable or invalid session object on the request). |
|
|
Emitted after checking the authentication status of a user based on their session data. |
|
|
Emitted when a user’s session is successfully deleted as part of the logout process. |
|