class Method implements MethodInterface (View source)

Enables time-based one-time password (TOTP) authentication for the silverstripe/mfa module.

Traits

Provides extensions to this object to integrate it with standard config API methods.

Config options

code_length int

The TOTP code length

Properties

Methods

public static 
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

public
mixed
uninherited(string $name)

Gets the uninherited value for the given config option

public
string
getName()

Provide a localised name for this MFA Method.

public
string
getURLSegment()

Get a URL segment for this method. This will be used in URL paths for performing authentication by this method

public
getVerifyHandler()

Return the VerifyHandler that is used to start and check verification attempts with this method

public
getRegisterHandler()

Return the RegisterHandler that is used to perform registrations with this method

public
string
getThumbnail()

Return a URL to an image to be used as a thumbnail in the MFA login/registration grid for all MFA methods

public
void
applyRequirements()

Leverage the Requirements API to ensure client requirements are included. This is called just after the base module requirements are specified

public
bool
isAvailable()

TOTP authentication is only available if the required environment variable is set to enable encryption.

public
string
getUnavailableMessage()

If not available to be used, provide a message to display on the frontend to explain why.

public
int
getCodeLength()

Get the length of the TOTP code

Details

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

string getName()

Provide a localised name for this MFA Method.

eg. "Authenticator app"

Return Value

string

string getURLSegment()

Get a URL segment for this method. This will be used in URL paths for performing authentication by this method

Return Value

string

VerifyHandlerInterface getVerifyHandler()

Return the VerifyHandler that is used to start and check verification attempts with this method

Return Value

VerifyHandlerInterface

RegisterHandlerInterface getRegisterHandler()

Return the RegisterHandler that is used to perform registrations with this method

string getThumbnail()

Return a URL to an image to be used as a thumbnail in the MFA login/registration grid for all MFA methods

Return Value

string

void applyRequirements()

Leverage the Requirements API to ensure client requirements are included. This is called just after the base module requirements are specified

Return Value

void

bool isAvailable()

TOTP authentication is only available if the required environment variable is set to enable encryption.

Return Value

bool

string getUnavailableMessage()

If not available to be used, provide a message to display on the frontend to explain why.

Return Value

string

int getCodeLength()

Get the length of the TOTP code

Return Value

int