Home Assistant Unofficial Reference 2024.12.1
homeassistant.auth.mfa_modules.totp Namespace Reference

Classes

class  TotpAuthModule
 
class  TotpSetupFlow
 

Functions

str _generate_qr_code (str data)
 
tuple[str, str, str] _generate_secret_and_qr_code (str username)
 

Variables

 CONFIG_SCHEMA = MULTI_FACTOR_AUTH_MODULE_SCHEMA.extend({}, extra=vol.PREVENT_EXTRA)
 
string DUMMY_SECRET = "FPPTH34D4E3MI2HG"
 
string INPUT_FIELD_CODE = "code"
 
list REQUIREMENTS = ["pyotp==2.8.0", "PyQRCode==1.2.1"]
 
string STORAGE_KEY = "auth_module.totp"
 
string STORAGE_OTA_SECRET = "ota_secret"
 
string STORAGE_USER_ID = "user_id"
 
string STORAGE_USERS = "users"
 
int STORAGE_VERSION = 1
 

Detailed Description

Time-based One Time Password auth module.

Function Documentation

◆ _generate_qr_code()

str homeassistant.auth.mfa_modules.totp._generate_qr_code ( str  data)
private
Generate a base64 PNG string represent QR Code image of data.

Definition at line 38 of file totp.py.

◆ _generate_secret_and_qr_code()

tuple[str, str, str] homeassistant.auth.mfa_modules.totp._generate_secret_and_qr_code ( str  username)
private
Generate a secret, url, and QR code.

Definition at line 60 of file totp.py.

Variable Documentation

◆ CONFIG_SCHEMA

homeassistant.auth.mfa_modules.totp.CONFIG_SCHEMA = MULTI_FACTOR_AUTH_MODULE_SCHEMA.extend({}, extra=vol.PREVENT_EXTRA)

Definition at line 25 of file totp.py.

◆ DUMMY_SECRET

string homeassistant.auth.mfa_modules.totp.DUMMY_SECRET = "FPPTH34D4E3MI2HG"

Definition at line 35 of file totp.py.

◆ INPUT_FIELD_CODE

string homeassistant.auth.mfa_modules.totp.INPUT_FIELD_CODE = "code"

Definition at line 33 of file totp.py.

◆ REQUIREMENTS

list homeassistant.auth.mfa_modules.totp.REQUIREMENTS = ["pyotp==2.8.0", "PyQRCode==1.2.1"]

Definition at line 23 of file totp.py.

◆ STORAGE_KEY

string homeassistant.auth.mfa_modules.totp.STORAGE_KEY = "auth_module.totp"

Definition at line 28 of file totp.py.

◆ STORAGE_OTA_SECRET

string homeassistant.auth.mfa_modules.totp.STORAGE_OTA_SECRET = "ota_secret"

Definition at line 31 of file totp.py.

◆ STORAGE_USER_ID

string homeassistant.auth.mfa_modules.totp.STORAGE_USER_ID = "user_id"

Definition at line 30 of file totp.py.

◆ STORAGE_USERS

string homeassistant.auth.mfa_modules.totp.STORAGE_USERS = "users"

Definition at line 29 of file totp.py.

◆ STORAGE_VERSION

int homeassistant.auth.mfa_modules.totp.STORAGE_VERSION = 1

Definition at line 27 of file totp.py.