‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes Class Reference

Public Member Functions

 __construct (protected readonly string $mode)
 
 generateRecoveryCodes ()
 
string[] generatePlainRecoveryCodes (int $length=8, int $quantity=8)
 
 generatedHashedRecoveryCodes (array $codes)
 
 verifyRecoveryCode (string $recoveryCode, array &$codes)
 

Protected Attributes

PasswordHashFactory $passwordHashFactory
 

Private Attributes

const MIN_LENGTH = 8
 

Detailed Description

Implementation for generation and validation of recovery codes

should only be used by the TYPO3 Core

Definition at line 29 of file RecoveryCodes.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes::__construct ( protected readonly string  $mode)

Definition at line 35 of file RecoveryCodes.php.

Member Function Documentation

◆ generatedHashedRecoveryCodes()

TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes::generatedHashedRecoveryCodes ( array  $codes)

Hash the given plain recovery codes with the default hash instance and return them

Definition at line 86 of file RecoveryCodes.php.

Referenced by TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes\generateRecoveryCodes().

◆ generatePlainRecoveryCodes()

string [] TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes::generatePlainRecoveryCodes ( int  $length = 8,
int  $quantity = 8 
)

Generate given amount of plain recovery codes with the given length

Returns
‪string[]

Definition at line 54 of file RecoveryCodes.php.

Referenced by TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes\generateRecoveryCodes().

◆ generateRecoveryCodes()

TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes::generateRecoveryCodes ( )

◆ verifyRecoveryCode()

TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes::verifyRecoveryCode ( string  $recoveryCode,
array &  $codes 
)

Compare given recovery code against all hashed codes and unset the corresponding code on success.

Definition at line 102 of file RecoveryCodes.php.

Member Data Documentation

◆ $passwordHashFactory

PasswordHashFactory TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes::$passwordHashFactory
protected

Definition at line 33 of file RecoveryCodes.php.

◆ MIN_LENGTH

const TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes::MIN_LENGTH = 8
private

Definition at line 31 of file RecoveryCodes.php.