class TwoFactorPlugin

Two factor authentication plugin class

This is basic implementation which does no additional authentication, subclasses are expected to implement this.

Properties

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

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

Details

at line 63
__construct(TwoFactor $twofactor)

Creates object

Parameters

TwoFactor $twofactor TwoFactor instance

at line 76
string getError()

Returns authentication error message

Return Value

string

at line 96
boolean check()

Checks authentication, returns true on success

Return Value

boolean

at line 106
string render()

Renders user interface to enter two-factor authentication

Return Value

string HTML code

at line 116
string setup()

Renders user interface to configure two-factor authentication

Return Value

string HTML code

at line 126
boolean configure()

Performs backend configuration

Return Value

boolean

at line 136
static string getName()

Get user visible name

Return Value

string

at line 146
static string getDescription()

Get user visible description

Return Value

string

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