class TwoFactorPlugin (View source)

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 bool $showSubmit

Whether to show submit button in form

protected bool $provided
protected string $message
Template $template

Methods

__construct(TwoFactor $twofactor)

No description

string
getError()

Returns authentication error message

bool
check(ServerRequest $request)

Checks authentication, returns true on success

string
render(ServerRequest $request)

Renders user interface to enter two-factor authentication

string
setup(ServerRequest $request)

Renders user interface to configure two-factor authentication

bool
configure(ServerRequest $request)

Performs backend configuration

static string
getName()

Get user visible name

static string
getDescription()

Get user visible description

string
getAppId(bool $returnUrl)

Return an application ID

Details

__construct(TwoFactor $twofactor)

No description

Parameters

TwoFactor $twofactor

string getError()

Returns authentication error message

Return Value

string

bool check(ServerRequest $request)

Checks authentication, returns true on success

Parameters

ServerRequest $request

Return Value

bool

string render(ServerRequest $request)

Renders user interface to enter two-factor authentication

Parameters

ServerRequest $request

Return Value

string

HTML code

string setup(ServerRequest $request)

Renders user interface to configure two-factor authentication

Parameters

ServerRequest $request

Return Value

string

HTML code

bool configure(ServerRequest $request)

Performs backend configuration

Parameters

ServerRequest $request

Return Value

bool

static string getName()

Get user visible name

Return Value

string

static string getDescription()

Get user visible description

Return Value

string

string getAppId(bool $returnUrl)

Return an application ID

Either hostname or hostname with scheme.

Parameters

bool $returnUrl

Whether to generate URL

Return Value

string