graph LR
TwoFactorAuth_Model["TwoFactorAuth Model"]
Device_Base_Class["Device Base Class"]
PhoneDevice_Model["PhoneDevice Model"]
TwoFactorAuth_Model -- "links to" --> Device_Base_Class
PhoneDevice_Model -- "inherits from" --> Device_Base_Class
TwoFactorAuth_Model -- "references" --> PhoneDevice_Model
The two-factor authentication subsystem is structured around a central TwoFactorAuth model (two_factor.models.TwoFactorAuth) that orchestrates a user's 2FA settings. This model interacts with a hierarchy of OTP device implementations, all stemming from the abstract Device base class (django_otp.models.Device). Concrete device types, such as the PhoneDevice (two_factor.plugins.phonenumber.models.PhoneDevice), extend this base class to provide specific authentication mechanisms like SMS-based OTP. This design allows for flexible integration of various 2FA methods while maintaining a consistent interface for managing user authentication.
Manages a user's 2FA configuration.
Related Classes/Methods:
Abstract base class, defining the common interface for all OTP devices.
Related Classes/Methods:
Extends the Device base class to provide specific authentication methods (e.g., SMS-based OTP).
Related Classes/Methods: