MediaWiki  1.33.0
TOTPSecondaryAuthenticationProvider Class Reference

AuthManager secondary authentication provider for TOTP second-factor authentication. More...

Inheritance diagram for TOTPSecondaryAuthenticationProvider:
Collaboration diagram for TOTPSecondaryAuthenticationProvider:

Public Member Functions

 beginSecondaryAccountCreation ( $user, $creator, array $reqs)
 
 beginSecondaryAuthentication ( $user, array $reqs)
 If the user has enabled two-factor authentication, request a second factor. More...
 
 continueSecondaryAuthentication ( $user, array $reqs)
 Verify the second factor. More...
 
 getAuthenticationRequests ( $action, array $options)
 
- Public Member Functions inherited from MediaWiki\Auth\AbstractSecondaryAuthenticationProvider
 autoCreatedAccount ( $user, $source)
 Post-auto-creation callback. More...
 
 continueSecondaryAccountCreation ( $user, $creator, array $reqs)
 Continue an authentication flow. More...
 
 postAccountCreation ( $user, $creator, AuthenticationResponse $response)
 Post-creation callback. More...
 
 postAuthentication ( $user, AuthenticationResponse $response)
 Post-login callback. More...
 
 providerAllowsAuthenticationDataChange (AuthenticationRequest $req, $checkData=true)
 Validate a change of authentication data (e.g. More...
 
 providerAllowsPropertyChange ( $property)
 Determine whether a property can change. More...
 
 providerChangeAuthenticationData (AuthenticationRequest $req)
 Change or remove authentication data (e.g. More...
 
 providerRevokeAccessForUser ( $username)
 @inheritDoc More...
 
 testForAccountCreation ( $user, $creator, array $reqs)
 Determine whether an account creation may begin. More...
 
 testUserForCreation ( $user, $autocreate, array $options=[])
 Determine whether an account may be created. More...
 
- Public Member Functions inherited from MediaWiki\Auth\AbstractAuthenticationProvider
 getUniqueId ()
 @inheritDoc More...
 
 setConfig (Config $config)
 Set configuration. More...
 
 setLogger (LoggerInterface $logger)
 
 setManager (AuthManager $manager)
 Set AuthManager. More...
 

Additional Inherited Members

- Protected Attributes inherited from MediaWiki\Auth\AbstractAuthenticationProvider
Config $config
 
LoggerInterface $logger
 
AuthManager $manager
 

Detailed Description

AuthManager secondary authentication provider for TOTP second-factor authentication.

After a successful primary authentication, requests a time-based one-time password (typically generated by a mobile app such as Google Authenticator) from the user.

See also
AuthManager
https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm

Definition at line 33 of file TOTPSecondaryAuthenticationProvider.php.

Member Function Documentation

◆ beginSecondaryAccountCreation()

TOTPSecondaryAuthenticationProvider::beginSecondaryAccountCreation (   $user,
  $creator,
array  $reqs 
)
Parameters
User$user
User$creator
array$reqs
Returns
AuthenticationResponse

Implements MediaWiki\Auth\SecondaryAuthenticationProvider.

Definition at line 118 of file TOTPSecondaryAuthenticationProvider.php.

◆ beginSecondaryAuthentication()

TOTPSecondaryAuthenticationProvider::beginSecondaryAuthentication (   $user,
array  $reqs 
)

If the user has enabled two-factor authentication, request a second factor.

Parameters
User$user
array$reqs
Returns
AuthenticationResponse

Implements MediaWiki\Auth\SecondaryAuthenticationProvider.

Definition at line 59 of file TOTPSecondaryAuthenticationProvider.php.

References $user, OATHAuthHooks\getOATHUserRepository(), null, and wfMessage().

◆ continueSecondaryAuthentication()

TOTPSecondaryAuthenticationProvider::continueSecondaryAuthentication (   $user,
array  $reqs 
)

Verify the second factor.

@inheritDoc

Reimplemented from MediaWiki\Auth\AbstractSecondaryAuthenticationProvider.

Definition at line 74 of file TOTPSecondaryAuthenticationProvider.php.

References $request, $user, class, OATHAuthHooks\getOATHUserRepository(), null, and wfMessage().

◆ getAuthenticationRequests()

TOTPSecondaryAuthenticationProvider::getAuthenticationRequests (   $action,
array  $options 
)
Parameters
string$action
array$options
Returns
array

Implements MediaWiki\Auth\AuthenticationProvider.

Definition at line 41 of file TOTPSecondaryAuthenticationProvider.php.


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