ESET Secure Authentication SDK documentation
 All Classes Namespaces Functions Variables
Public Member Functions | List of all members
ESET\SecureAuthentication\SDK\TwoFactorUser Class Reference
Inheritance diagram for ESET\SecureAuthentication\SDK\TwoFactorUser:
ESET\SecureAuthentication\SDK\ITwoFactorUser

Public Member Functions

 __construct ($userStorage, $auditor, $user, $hasChanges=false)
 
 getUserId ()
 
 getMobileNumber ()
 
 setMobileNumber ($value)
 
 getIsLocked ()
 
 getLastSuccess ()
 
 getLastFailure ()
 
 getConsecutiveFailures ()
 
 getCredentialType ()
 
 deProvisionTwoFactor ()
 
 unlock ()
 
 provisionMobileApp ($allowTransitioning=true)
 
 sendMobileAppProvisioningTextMessage (ProvisionMobileAppResult $provisionResult)
 
 provisionTextMessage ($allowTransitioning=true)
 
 getHasChanges ()
 
 save ()
 

Member Function Documentation

ESET\SecureAuthentication\SDK\TwoFactorUser::deProvisionTwoFactor ( )

Disable 2FA for the user

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::getConsecutiveFailures ( )

Retrieve the number of consecutive authentication failures

Returns
int

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::getCredentialType ( )
ESET\SecureAuthentication\SDK\TwoFactorUser::getHasChanges ( )

Determine if the user object has changes which need to be saved

Returns
bool True: user object has changed; False: user object has not changed

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::getIsLocked ( )

Retrieve the user's account lock status

Returns
bool True: account is locked; False: account is not locked

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::getLastFailure ( )

Retrive the date and time of the last failed authentication

Returns
int Unix timestamp

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::getLastSuccess ( )

Retrieve the date and time of the last successful authentication

Returns
int Unix timestamp

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::getMobileNumber ( )

Retrieve the user's mobile number

Returns
string

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::getUserId ( )

Retrieve the user's user ID, typically the username

Returns
string

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::provisionMobileApp (   $allowTransitioning = true)

Provision the user for mobile app OTPs

If the user previously had text message OTPs enabled and $allowTransitioning is True, the user will continue to receive text message OTPs until they successfully authenticate with a mobile app OTP. At this time text message OTPs will be disabled automatically.

If $allowTransitioning is False, the existing credential is replaced immediately.

An installation text message is NOT automatically sent.

Parameters
bool$allowTransitioningTrue: Allow transitioning from text message OTPs; False: replace existing credential with mobile app OTPs immediately
Returns
ProvisionMobileAppResult

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::provisionTextMessage (   $allowTransitioning = true)

Provision the user for text message OTPs

If the user previously had mobile app OTPs enabled and $allowTransitioning is True, the user will receive text message OTPs until they successfully authenticate with a mobile app OTP. At this time text message OTPs will be disabled automatically. This is used to temporarily allow text message OTPs until the user can access the app again.

If $allowTransitioning is False, the existing credential is replaced immediately.

Parameters
bool$allowTransitioningTrue: Allow transitioning; False: replace existing credential with mobile app OTPs immediately

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::save ( )

Save changes to the user object

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::sendMobileAppProvisioningTextMessage ( ProvisionMobileAppResult  $provisionResult)

Send a mobile app installation text message to the user

Parameters
ProvisionMobileAppResult$provisionResult

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::setMobileNumber (   $value)

Set the user's mobile number

Parameters
string$value

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.

ESET\SecureAuthentication\SDK\TwoFactorUser::unlock ( )

Unlock the user's 2FA account

Accounts are locked when too many consecutive authentication failures occur.

Implements ESET\SecureAuthentication\SDK\ITwoFactorUser.