Mfa
MMO\oauth\helpers · 1 symbole · générée le 30 Nov 2026
Mfa
Mfa.php:18The second factor of a login by password: a TOTP (Totp) enrolled from a QR code, and recovery codes for a phone lost (ISO 27001 A.8.5, A.5.17). What a user keeps (mfa, tUser::$mfa): its secret encrypted with $keyFile's key, the step of the last code accepted (a code is accepted once), the recovery codes hashed with that key, each used once. AccessController::$mfa gives its options and asks it at the login
- Espace de noms
MMO\oauth\helpers
Index
| issuer | ||
| key | ||
| keyFile | ||
| pendingTTL | ||
| recoveryCodes | ||
| required | ||
| window | ||
| applies($user) | ||
| enrol($user, $secret, $code) | Enrol $secret as $user's second factor, if $code is one of it: the user's app has it | |
| hashRecovery($code) | ||
| isEnrolled($user) | ||
| isRequired($user) | ||
| key() | ||
| newSecret() | ||
| recoveryLeft($user) | ||
| reset($user) | Remove $user's second factor: it enrols a new one at its next login, if it is required to | |
| uri($user, $secret) | ||
| verify($user, $code) | Check a code of $user's second factor, or one of its recovery codes: a code accepted is no longer (its step, or the recovery code, is kept in the user, which the caller commits) | |
| __construct($options) |
Propriétés7
issuer
key
keyFile
- Type
- string
pendingTTL
- Type
- int
recoveryCodes
- Type
- int
required
- Type
- array
window
- Type
- int
Méthodes12
applies($user)
Mfa.php:55enrol($user, $secret, $code)
Mfa.php:74Enrol $secret as $user's second factor, if $code is one of it: the user's app has it
| $user | iUser | |
| $secret | string | |
| $code | string | |
| retourne | null | array | the recovery codes, to show once; null if $code is not one of $secret |
hashRecovery($code)
Mfa.php:137isEnrolled($user)
Mfa.php:50isRequired($user)
Mfa.php:42key()
Mfa.php:145newSecret()
Mfa.php:60recoveryLeft($user)
Mfa.php:127reset($user)
Mfa.php:132Remove $user's second factor: it enrols a new one at its next login, if it is required to
uri($user, $secret)
Mfa.php:65verify($user, $code)
Mfa.php:99Check a code of $user's second factor, or one of its recovery codes: a code accepted is no longer (its step, or the recovery code, is kept in the user, which the caller commits)
| $user | iUser | |
| $code | string | |
| retourne | null | string | totp or recovery for a code accepted, null otherwise (none enrolled included) |
__construct($options)
Mfa.php:35| $options = [] | array |