Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
Auth2FATrait Class Reference
+ Inheritance diagram for Auth2FATrait:

Public Member Functions

 _getBodySelector ()
 
 _getUserSessionKey ()
 
 bad2FACode ()
 @noRoute
 
 confirm ()
 @noRoute
 
 submitCode ()
 Submits the 2FA code in post request.
 
 sendNew2FACode ()
 

Protected Member Functions

 fMessage (FlashMessage $fMessage, $id=null)
 
 _getFiles ()
 
 getBaseUrl ()
 
 authLoadView ($viewName, $vars=[])
 
 useAjax ()
 
 onConnect ($connected)
 
 initializeAuth ()
 
 finalizeAuth ()
 
 has2FA ($accountValue=null)
 To override Returns true for a two factor authentification for this account.
 
 onBad2FACode ()
 To override for defining a new action when 2FA code is invalid.
 
 _send2FACode (string $code, $connected)
 To override Send the 2FA code to the user (email, sms, phone call...)
 
 getTokenSize ()
 To override Returns the default size for generated tokens.
 
 generate2FACode ()
 Generates a new random 2FA code.
 
 towFACodePrefix ()
 Returns the code prefix (which should not be entered by the user).
 
 twoFACodeDuration ()
 Returns the default validity duration of a generated 2FA code.
 
 twoFAMessage (FlashMessage $fMessage)
 To override for modifying the 2FA panel message.
 
 newTwoFACodeMessage (FlashMessage $fMessage)
 To override.
 
 twoFABadCodeMessage (FlashMessage $fMessage)
 To override for modifying the message displayed if the 2FA code is bad.
 
 check2FACode (string $secret, string $userInput)
 To override for a more secure 2FA code.
 
 save2FACode ()
 
 send2FACode ()
 

Static Private Attributes

static $TWO_FA_KEY ='2FA-infos'
 

Detailed Description

Definition at line 21 of file Auth2FATrait.php.

Member Function Documentation

◆ _getBodySelector()

_getBodySelector ( )
abstract

Reimplemented in AuthControllerConfig.

◆ _getFiles()

_getFiles ( )
abstractprotected

◆ _getUserSessionKey()

_getUserSessionKey ( )
abstract

Reimplemented in AuthControllerConfig.

◆ _send2FACode()

_send2FACode ( string  $code,
  $connected 
)
protected

To override Send the 2FA code to the user (email, sms, phone call...)

Parameters
string$code
mixed$connected

Definition at line 70 of file Auth2FATrait.php.

◆ authLoadView()

authLoadView (   $viewName,
  $vars = [] 
)
abstractprotected

◆ bad2FACode()

bad2FACode ( )

@noRoute

Definition at line 147 of file Auth2FATrait.php.

◆ check2FACode()

check2FACode ( string  $secret,
string  $userInput 
)
protected

To override for a more secure 2FA code.

Parameters
string$secret
string$userInput
Returns
bool

Definition at line 139 of file Auth2FATrait.php.

◆ confirm()

confirm ( )

@noRoute

Definition at line 159 of file Auth2FATrait.php.

◆ finalizeAuth()

finalizeAuth ( )
abstractprotected

Reimplemented in AuthController.

◆ fMessage()

fMessage ( FlashMessage  $fMessage,
  $id = null 
)
abstractprotected

◆ generate2FACode()

generate2FACode ( )
protected

Generates a new random 2FA code.

You have to override this basic implementation.

Returns
string
Exceptions

Exception

Definition at line 89 of file Auth2FATrait.php.

◆ getBaseUrl()

getBaseUrl ( )
abstractprotected

◆ getTokenSize()

getTokenSize ( )
protected

To override Returns the default size for generated tokens.

Returns
int

Reimplemented in AuthControllerConfig.

Definition at line 79 of file Auth2FATrait.php.

◆ has2FA()

has2FA (   $accountValue = null)
protected

To override Returns true for a two factor authentification for this account.

Parameters
mixed$accountValue
Returns
bool

Definition at line 53 of file Auth2FATrait.php.

◆ initializeAuth()

initializeAuth ( )
abstractprotected

Reimplemented in AuthController.

◆ newTwoFACodeMessage()

newTwoFACodeMessage ( FlashMessage  $fMessage)
protected

To override.

Parameters
FlashMessage$fMessage

Definition at line 121 of file Auth2FATrait.php.

◆ onBad2FACode()

onBad2FACode ( )
protected

To override for defining a new action when 2FA code is invalid.

Definition at line 60 of file Auth2FATrait.php.

◆ onConnect()

onConnect (   $connected)
abstractprotected

◆ save2FACode()

save2FACode ( )
protected

Definition at line 171 of file Auth2FATrait.php.

◆ send2FACode()

send2FACode ( )
protected

Definition at line 201 of file Auth2FATrait.php.

◆ sendNew2FACode()

sendNew2FACode ( )

Definition at line 206 of file Auth2FATrait.php.

◆ submitCode()

submitCode ( )

Submits the 2FA code in post request.

Postcondition

Definition at line 185 of file Auth2FATrait.php.

◆ towFACodePrefix()

towFACodePrefix ( )
protected

Returns the code prefix (which should not be entered by the user).

Returns
string

Reimplemented in AuthControllerConfig.

Definition at line 97 of file Auth2FATrait.php.

◆ twoFABadCodeMessage()

twoFABadCodeMessage ( FlashMessage  $fMessage)
protected

To override for modifying the message displayed if the 2FA code is bad.

Parameters
FlashMessage$fMessage

Definition at line 129 of file Auth2FATrait.php.

◆ twoFACodeDuration()

twoFACodeDuration ( )
protected

Returns the default validity duration of a generated 2FA code.

Returns
\DateInterval

Definition at line 106 of file Auth2FATrait.php.

◆ twoFAMessage()

twoFAMessage ( FlashMessage  $fMessage)
protected

To override for modifying the 2FA panel message.

Parameters
FlashMessage$fMessage

Definition at line 114 of file Auth2FATrait.php.

◆ useAjax()

useAjax ( )
abstractprotected

Reimplemented in AuthControllerConfig.

Field Documentation

◆ $TWO_FA_KEY

$TWO_FA_KEY ='2FA-infos'
staticprivate

Definition at line 23 of file Auth2FATrait.php.


The documentation for this class was generated from the following file: