MfaConfigurationController extends AbstractMfaController
Controller to configure MFA providers in the backend
This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
Attributes
- #[AsController]
Table of Contents
Properties
- $allowedActions : array<string|int, mixed>
- $allowedProviders : array<string|int, mixed>
- $iconFactory : IconFactory
- $mfaProviderRegistry : MfaProviderRegistry
- $mfaRequired : bool
- $mfaTsConfig : array<string|int, mixed>
- $moduleTemplateFactory : ModuleTemplateFactory
- $uriBuilder : UriBuilder
- $view : ModuleTemplate
Methods
- __construct() : mixed
- handleRequest() : ResponseInterface
- Main entry point, checking prerequisite, initializing and setting up the view and finally dispatching to the requested action.
- injectMfaProviderRegistry() : void
- activateAction() : ResponseInterface
- Handle activate request, receiving from the setup view by forwarding the request to the appropriate provider.
- addFlashMessage() : void
- addFormButtons() : void
- addOverviewButtons() : void
- deactivateAction() : ResponseInterface
- Handle deactivate request by forwarding the request to the appropriate provider. Also remove the provider as default provider from user UC, if set.
- editAction() : ResponseInterface
- Render form to edit a provider by using provider specific content
- getActionUri() : UriInterface
- Build a uri for the current controller based on the given action, respecting additional parameters.
- getBackendUser() : BackendUserAuthentication
- getDefaultProviderIdentifier() : string
- Get the default provider
- getLanguageService() : LanguageService
- getRecommendedProvider() : MfaProviderManifestInterface|null
- Get the recommended provider
- getRecommendedProviderIdentifier() : string
- Get the recommended provider
- getReturnUrl() : string
- hasSuitableDefaultProviders() : bool
- Check if there are more suitable default providers for the current user
- initializeMfaConfiguration() : void
- Initialize MFA configuration based on TSconfig and global configuration
- isActionAllowed() : bool
- isDefaultProvider() : bool
- isProviderAllowed() : bool
- isValidIdentifier() : bool
- overviewAction() : ResponseInterface
- Setup the overview with all available MFA providers
- removeDefaultProvider() : void
- saveAction() : ResponseInterface
- Handle save request, receiving from the edit view by forwarding the request to the appropriate provider.
- setDefaultProvider() : void
- setupAction() : ResponseInterface
- Render form to setup a provider by using provider specific content
- unlockAction() : ResponseInterface
- Handle unlock request by forwarding the request to the appropriate provider
Properties
$allowedActions
protected
array<string|int, mixed>
$allowedActions
= ['overview', 'setup', 'activate', 'deactivate', 'unlock', 'edit', 'save']
$allowedProviders
protected
array<string|int, mixed>
$allowedProviders
$iconFactory read-only
protected
IconFactory
$iconFactory
$mfaProviderRegistry
protected
MfaProviderRegistry
$mfaProviderRegistry
$mfaRequired
protected
bool
$mfaRequired
$mfaTsConfig
protected
array<string|int, mixed>
$mfaTsConfig
$moduleTemplateFactory read-only
protected
ModuleTemplateFactory
$moduleTemplateFactory
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
$view
protected
ModuleTemplate
$view
Methods
__construct()
public
__construct(IconFactory $iconFactory, UriBuilder $uriBuilder, ModuleTemplateFactory $moduleTemplateFactory) : mixed
Parameters
- $iconFactory : IconFactory
- $uriBuilder : UriBuilder
- $moduleTemplateFactory : ModuleTemplateFactory
handleRequest()
Main entry point, checking prerequisite, initializing and setting up the view and finally dispatching to the requested action.
public
handleRequest(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfaceinjectMfaProviderRegistry()
public
injectMfaProviderRegistry(MfaProviderRegistry $mfaProviderRegistry) : void
Parameters
- $mfaProviderRegistry : MfaProviderRegistry
activateAction()
Handle activate request, receiving from the setup view by forwarding the request to the appropriate provider.
protected
activateAction(ServerRequestInterface $request, MfaProviderManifestInterface $mfaProvider) : ResponseInterface
Furthermore, add the provider as default provider in case it is the recommended provider for this user, or no default provider is yet defined the newly activated provider is allowed to be a default provider and there are no other providers which would suite as default provider.
Parameters
- $request : ServerRequestInterface
- $mfaProvider : MfaProviderManifestInterface
Return values
ResponseInterfaceaddFlashMessage()
protected
addFlashMessage(string $message[, string $title = '' ][, ContextualFeedbackSeverity $severity = ContextualFeedbackSeverity::INFO ]) : void
Parameters
- $message : string
- $title : string = ''
- $severity : ContextualFeedbackSeverity = ContextualFeedbackSeverity::INFO
addFormButtons()
protected
addFormButtons() : void
addOverviewButtons()
protected
addOverviewButtons(ServerRequestInterface $request) : void
Parameters
- $request : ServerRequestInterface
deactivateAction()
Handle deactivate request by forwarding the request to the appropriate provider. Also remove the provider as default provider from user UC, if set.
protected
deactivateAction(ServerRequestInterface $request, MfaProviderManifestInterface $mfaProvider) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $mfaProvider : MfaProviderManifestInterface
Return values
ResponseInterfaceeditAction()
Render form to edit a provider by using provider specific content
protected
editAction(ServerRequestInterface $request, MfaProviderManifestInterface $mfaProvider) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $mfaProvider : MfaProviderManifestInterface
Return values
ResponseInterfacegetActionUri()
Build a uri for the current controller based on the given action, respecting additional parameters.
protected
getActionUri(string $action[, array<string|int, mixed> $additionalParameters = [] ]) : UriInterface
Parameters
- $action : string
- $additionalParameters : array<string|int, mixed> = []
Return values
UriInterfacegetBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetDefaultProviderIdentifier()
Get the default provider
protected
getDefaultProviderIdentifier() : string
Return values
stringgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetRecommendedProvider()
Get the recommended provider
protected
getRecommendedProvider() : MfaProviderManifestInterface|null
Return values
MfaProviderManifestInterface|nullgetRecommendedProviderIdentifier()
Get the recommended provider
protected
getRecommendedProviderIdentifier() : string
Return values
stringgetReturnUrl()
protected
getReturnUrl(ServerRequestInterface $request) : string
Parameters
- $request : ServerRequestInterface
Return values
stringhasSuitableDefaultProviders()
Check if there are more suitable default providers for the current user
protected
hasSuitableDefaultProviders([array<string|int, mixed> $excludedProviders = [] ]) : bool
Parameters
- $excludedProviders : array<string|int, mixed> = []
Return values
boolinitializeMfaConfiguration()
Initialize MFA configuration based on TSconfig and global configuration
protected
initializeMfaConfiguration() : void
isActionAllowed()
protected
isActionAllowed(string $action) : bool
Parameters
- $action : string
Return values
boolisDefaultProvider()
protected
isDefaultProvider(MfaProviderManifestInterface $mfaProvider) : bool
Parameters
- $mfaProvider : MfaProviderManifestInterface
Return values
boolisProviderAllowed()
protected
isProviderAllowed(string $identifier) : bool
Parameters
- $identifier : string
Return values
boolisValidIdentifier()
protected
isValidIdentifier(string $identifier) : bool
Parameters
- $identifier : string
Return values
booloverviewAction()
Setup the overview with all available MFA providers
protected
overviewAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfaceremoveDefaultProvider()
protected
removeDefaultProvider() : void
saveAction()
Handle save request, receiving from the edit view by forwarding the request to the appropriate provider.
protected
saveAction(ServerRequestInterface $request, MfaProviderManifestInterface $mfaProvider) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $mfaProvider : MfaProviderManifestInterface
Return values
ResponseInterfacesetDefaultProvider()
protected
setDefaultProvider(MfaProviderManifestInterface $mfaProvider) : void
Parameters
- $mfaProvider : MfaProviderManifestInterface
setupAction()
Render form to setup a provider by using provider specific content
protected
setupAction(ServerRequestInterface $request, MfaProviderManifestInterface $mfaProvider) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $mfaProvider : MfaProviderManifestInterface
Return values
ResponseInterfaceunlockAction()
Handle unlock request by forwarding the request to the appropriate provider
protected
unlockAction(ServerRequestInterface $request, MfaProviderManifestInterface $mfaProvider) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $mfaProvider : MfaProviderManifestInterface