‪TYPO3CMS  11.5
TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider Class Reference
Inheritance diagram for TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider:
TYPO3\CMS\Core\Authentication\Mfa\MfaProviderInterface

Public Member Functions

 __construct (Context $context)
 
bool canProcess (ServerRequestInterface $request)
 
bool isActive (MfaProviderPropertyManager $propertyManager)
 
bool isLocked (MfaProviderPropertyManager $propertyManager)
 
bool verify (ServerRequestInterface $request, MfaProviderPropertyManager $propertyManager)
 
bool activate (ServerRequestInterface $request, MfaProviderPropertyManager $propertyManager)
 
bool update (ServerRequestInterface $request, MfaProviderPropertyManager $propertyManager)
 
bool unlock (ServerRequestInterface $request, MfaProviderPropertyManager $propertyManager)
 
bool deactivate (ServerRequestInterface $request, MfaProviderPropertyManager $propertyManager)
 
ResponseInterface handleRequest (ServerRequestInterface $request, MfaProviderPropertyManager $propertyManager, string $type)
 

Protected Member Functions

 prepareSetupView (StandaloneView $view, MfaProviderPropertyManager $propertyManager)
 
 prepareEditView (StandaloneView $view, MfaProviderPropertyManager $propertyManager)
 
 prepareAuthView (StandaloneView $view, MfaProviderPropertyManager $propertyManager)
 
string getTotp (ServerRequestInterface $request)
 
string getSvgQrCode (string $content)
 
string getDateTime (int $timestamp)
 

Protected Attributes

Context $context
 

Private Attributes

const MAX_ATTEMPTS = 3
 

Detailed Description

MFA provider for time-based one-time password authentication

should only be used by the TYPO3 Core

Definition at line 39 of file TotpProvider.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::__construct ( Context  $context)

Member Function Documentation

◆ activate()

bool TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::activate ( ServerRequestInterface  $request,
MfaProviderPropertyManager  $propertyManager 
)

◆ canProcess()

bool TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::canProcess ( ServerRequestInterface  $request)

Check if a TOTP is given in the current request

Parameters
ServerRequestInterface$request
Returns
‪bool

Implements TYPO3\CMS\Core\Authentication\Mfa\MfaProviderInterface.

Definition at line 56 of file TotpProvider.php.

References TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\getTotp().

Referenced by TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\activate().

◆ deactivate()

bool TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::deactivate ( ServerRequestInterface  $request,
MfaProviderPropertyManager  $propertyManager 
)

Handle the deactivate action. For security reasons, the provider entry is completely deleted and setting up this provider again, will therefore create a brand new entry.

Parameters
ServerRequestInterface$request
MfaProviderPropertyManager$propertyManager
Returns
‪bool

Implements TYPO3\CMS\Core\Authentication\Mfa\MfaProviderInterface.

Definition at line 215 of file TotpProvider.php.

References TYPO3\CMS\Core\Authentication\Mfa\MfaProviderPropertyManager\deleteProviderEntry(), and TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\isActive().

◆ getDateTime()

string TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::getDateTime ( int  $timestamp)
protected

Return the timestamp as local time (date string) by applying the globally configured format

Parameters
int$timestamp
Returns
‪string

Definition at line 335 of file TotpProvider.php.

References $GLOBALS.

◆ getSvgQrCode()

string TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::getSvgQrCode ( string  $content)
protected

Internal helper method for generating a svg QR-code for TOTP applications

Parameters
string$content
Returns
‪string

Definition at line 319 of file TotpProvider.php.

Referenced by TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\prepareSetupView().

◆ getTotp()

string TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::getTotp ( ServerRequestInterface  $request)
protected

Internal helper method for fetching the TOTP from the request

Parameters
ServerRequestInterface$request
Returns
‪string

Definition at line 308 of file TotpProvider.php.

Referenced by TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\canProcess(), and TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\verify().

◆ handleRequest()

ResponseInterface TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::handleRequest ( ServerRequestInterface  $request,
MfaProviderPropertyManager  $propertyManager,
string  $type 
)

◆ isActive()

◆ isLocked()

◆ prepareAuthView()

TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::prepareAuthView ( StandaloneView  $view,
MfaProviderPropertyManager  $propertyManager 
)
protected

◆ prepareEditView()

TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::prepareEditView ( StandaloneView  $view,
MfaProviderPropertyManager  $propertyManager 
)
protected

◆ prepareSetupView()

TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::prepareSetupView ( StandaloneView  $view,
MfaProviderPropertyManager  $propertyManager 
)
protected

◆ unlock()

bool TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::unlock ( ServerRequestInterface  $request,
MfaProviderPropertyManager  $propertyManager 
)

Handle the unlock action by resetting the attempts provider property

Parameters
ServerRequestInterface$request
MfaProviderPropertyManager$propertyManager
Returns
‪bool

Implements TYPO3\CMS\Core\Authentication\Mfa\MfaProviderInterface.

Definition at line 195 of file TotpProvider.php.

References TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\isActive(), TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider\isLocked(), and TYPO3\CMS\Core\Authentication\Mfa\MfaProviderPropertyManager\updateProperties().

◆ update()

bool TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::update ( ServerRequestInterface  $request,
MfaProviderPropertyManager  $propertyManager 
)

◆ verify()

bool TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::verify ( ServerRequestInterface  $request,
MfaProviderPropertyManager  $propertyManager 
)

Member Data Documentation

◆ $context

Context TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::$context
protected

◆ MAX_ATTEMPTS

const TYPO3\CMS\Core\Authentication\Mfa\Provider\TotpProvider::MAX_ATTEMPTS = 3
private