class Application extends TwoFactorPlugin

HOTP and TOTP based two-factor authentication

Also known as Google, Authy, or OTP

Properties

static string $id
static $showSubmit Whether to show submit button in form from TwoFactorPlugin
protected TwoFactor $_twofactor from TwoFactorPlugin
protected boolean $_provided from TwoFactorPlugin
protected string $_message from TwoFactorPlugin
Template $template from TwoFactorPlugin
protected $_google2fa

Methods

__construct(TwoFactor $twofactor)

Creates object

string
getError()

Returns authentication error message

boolean
check()

Checks authentication, returns true on success

string
render()

Renders user interface to enter two-factor authentication

string
setup()

Renders user interface to configure two-factor authentication

boolean
configure()

Performs backend configuration

static string
getName()

Get user visible name

static string
getDescription()

Get user visible description

string
getAppId(boolean $return_url)

Return an applicaiton ID

Google2FA
getGoogle2fa()

No description

Details

at line 40
__construct(TwoFactor $twofactor)

Creates object

Parameters

TwoFactor $twofactor TwoFactor instance

in TwoFactorPlugin at line 76
string getError()

Returns authentication error message

Return Value

string

at line 70
boolean check()

Checks authentication, returns true on success

Return Value

boolean

Exceptions

IncompatibleWithGoogleAuthenticatorException
InvalidCharactersException
SecretKeyTooShortException

at line 88
string render()

Renders user interface to enter two-factor authentication

Return Value

string HTML code

at line 98
string setup()

Renders user interface to configure two-factor authentication

Return Value

string HTML code

at line 121
boolean configure()

Performs backend configuration

Return Value

boolean

Exceptions

IncompatibleWithGoogleAuthenticatorException
InvalidCharactersException
SecretKeyTooShortException

at line 140
static string getName()

Get user visible name

Return Value

string

at line 150
static string getDescription()

Get user visible description

Return Value

string

in TwoFactorPlugin at line 160
string getAppId(boolean $return_url)

Return an applicaiton ID

Either hostname or hostname with scheme.

Parameters

boolean $return_url Whether to generate URL

Return Value

string

at line 57
Google2FA getGoogle2fa()

Return Value

Google2FA