trait RegistrationHandlerTrait (View source)

This trait encapsulates logic that can be added to a RequestHandler to work with registering MFA authenticators using the MFA front-end app. It provides two main methods; createStartRegistrationResponse - creates a response that can be easily consumed by the MFA app to start the registration process for a method, and

Methods

public
createStartRegistrationResponse(StoreInterface $store, MethodInterface $method, bool $allowReregistration = false)

Create a response that can be consumed by a front-end for starting a registration

public
completeRegistrationRequest(StoreInterface $store, MethodInterface $method, HTTPRequest $request)

Complete a registration request, returning a result object with a message and context for the result of the registration attempt.

Details

HTTPResponse createStartRegistrationResponse(StoreInterface $store, MethodInterface $method, bool $allowReregistration = false)

Create a response that can be consumed by a front-end for starting a registration

Parameters

StoreInterface $store
MethodInterface $method
bool $allowReregistration

By default this method will return an error response when registering methods that already have a registration.

Return Value

HTTPResponse

Result completeRegistrationRequest(StoreInterface $store, MethodInterface $method, HTTPRequest $request)

Complete a registration request, returning a result object with a message and context for the result of the registration attempt.

Parameters

StoreInterface $store
MethodInterface $method
HTTPRequest $request

Return Value

Result

Exceptions

ValidationException