class Key extends TwoFactorPlugin (View source)

Hardware key based two-factor authentication

Supports FIDO U2F tokens

Properties

static string $id
static bool $showSubmit

Whether to show submit button in form

from  TwoFactorPlugin
protected TwoFactor $twofactor from  TwoFactorPlugin
protected bool $provided from  TwoFactorPlugin
protected string $message from  TwoFactorPlugin
Template $template from  TwoFactorPlugin

Methods

__construct(TwoFactor $twofactor)

Creates object

string
getError()

Returns authentication error message

bool
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

bool
configure()

Performs backend configuration

static string
getName()

Get user visible name

static string
getDescription()

Get user visible description

string
getAppId(bool $return_url)

Return an application ID

array
getRegistrations()

Returns array of U2F registration objects

void
loadScripts()

Loads needed javascripts into the page

Details

__construct(TwoFactor $twofactor)

Creates object

Parameters

TwoFactor $twofactor

TwoFactor instance

string getError()

Returns authentication error message

Return Value

string

bool check()

Checks authentication, returns true on success

Return Value

bool

string render()

Renders user interface to enter two-factor authentication

Return Value

string

HTML code

string setup()

Renders user interface to configure two-factor authentication

Return Value

string

HTML code

Exceptions

U2FException
Throwable
LoaderError
RuntimeError
SyntaxError

bool configure()

Performs backend configuration

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 $return_url)

Return an application ID

Either hostname or hostname with scheme.

Parameters

bool $return_url

Whether to generate URL

Return Value

string

array getRegistrations()

Returns array of U2F registration objects

Return Value

array

void loadScripts()

Loads needed javascripts into the page

Return Value

void