LoginController

readonly class \TYPO3\CMS\Backend\Controller\LoginController

Uses
PageRendererBackendSetupTrait

Controller responsible for rendering the TYPO3 Backend login form.

Tags

todo:

The central template rendering magic needs an overhaul: Currently, LoginProviderInterface has to be implemented, which retrieves a "prepared" view with tons of variable used by the default Layout "Login.fluid.html". Single LoginProviderInterface then set their template path ("Login/UserPassLoginForm" in UsernamePasswordLoginProvider), which sets Login.fluid.html as layout in its template to then get its sections "loginFormFields" and "ResetPassword" rendered. This strategy is a major mess and needs to be turned around somehow. Note there is also this BE "relogin" and "login refresh" foo with lots of attached JS magic that should either be streamlined to actually work, or (preferred) be thrown away.

Attributes

#[AsController]

Table of Contents

Properties

$authenticationStyleInformation  : AuthenticationStyleInformation
$backendEntryPointResolver  : BackendEntryPointResolver
$connectionPool  : ConnectionPool
$context  : Context
$eventDispatcher  : EventDispatcherInterface
$extensionConfiguration  : ExtensionConfiguration
$features  : Features
$formProtectionFactory  : FormProtectionFactory
$locales  : Locales
$loginProviderResolver  : LoginProviderResolver
$pageRenderer  : PageRenderer
$typo3Information  : Typo3Information
$uriBuilder  : UriBuilder
$viewFactory  : ViewFactoryInterface

Methods

__construct()  : mixed
formAction()  : ResponseInterface
Injects the request and response objects for the current request or subrequest As this controller goes only through the main() method, it is rather simple for now
refreshAction()  : ResponseInterface
Calls the main function but with loginRefresh enabled at any time
requestTokenAction()  : ResponseInterface
Returns a new request-token value, which is signed by a new nonce value (the nonce is sent as cookie automatically in `RequestTokenMiddleware` since it is created via the `NoncePool`).
appendLoginProviderCookie()  : ResponseInterface
A login provider, which is not the primary one, is remembered in a cookie. Once the primary provider is used again, an existing cookie is expired instead of being set to the default.
checkRedirect()  : void
createLoginLogout()  : ResponseInterface
getBackendFavicon()  : string
Retrieves configured favicon for backend with fallback.
getBackendUserAuthentication()  : BackendUserAuthentication
getLanguageService()  : LanguageService
getSystemNews()  : array
Gets news as array from sys_news and converts them into a format suitable for showing them at the login screen.
getUriForFileName()  : string
Returns the uri for a system resource
isLoginInProgress()  : bool
Checks if login credentials have been submitted
loadStylesheets()  : void
Load all registered stylesheets from $GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets']
provideRequestTokenJwt()  : string
setUpBasicPageRendererForBackend()  : void
Sets mandatory parameters for the PageRenderer.

Properties

$eventDispatcher

protected EventDispatcherInterface $eventDispatcher

Methods

__construct()

public __construct(Typo3Information $typo3Information, EventDispatcherInterface $eventDispatcher, PageRenderer $pageRenderer, UriBuilder $uriBuilder, Features $features, Context $context, LoginProviderResolver $loginProviderResolver, ExtensionConfiguration $extensionConfiguration, BackendEntryPointResolver $backendEntryPointResolver, FormProtectionFactory $formProtectionFactory, Locales $locales, ConnectionPool $connectionPool, AuthenticationStyleInformation $authenticationStyleInformation, ViewFactoryInterface $viewFactory) : mixed

Parameters

$typo3Information : Typo3Information
$eventDispatcher : EventDispatcherInterface
$pageRenderer : PageRenderer
$uriBuilder : UriBuilder
$features : Features
$context : Context
$loginProviderResolver : LoginProviderResolver
$extensionConfiguration : ExtensionConfiguration
$backendEntryPointResolver : BackendEntryPointResolver
$formProtectionFactory : FormProtectionFactory
$locales : Locales
$connectionPool : ConnectionPool
$authenticationStyleInformation : AuthenticationStyleInformation
$viewFactory : ViewFactoryInterface

formAction()

Injects the request and response objects for the current request or subrequest As this controller goes only through the main() method, it is rather simple for now

public formAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

refreshAction()

Calls the main function but with loginRefresh enabled at any time

public refreshAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

requestTokenAction()

Returns a new request-token value, which is signed by a new nonce value (the nonce is sent as cookie automatically in `RequestTokenMiddleware` since it is created via the `NoncePool`).

public requestTokenAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

appendLoginProviderCookie()

A login provider, which is not the primary one, is remembered in a cookie. Once the primary provider is used again, an existing cookie is expired instead of being set to the default.

protected appendLoginProviderCookie(ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface

Parameters

$request : ServerRequestInterface
$response : ResponseInterface

Return values

ResponseInterface

getBackendFavicon()

Retrieves configured favicon for backend with fallback.

protected getBackendFavicon(ExtensionConfiguration $extensionConfiguration, ServerRequestInterface $request) : string

Parameters

$extensionConfiguration : ExtensionConfiguration
$request : ServerRequestInterface

Return values

string

getSystemNews()

Gets news as array from sys_news and converts them into a format suitable for showing them at the login screen.

protected getSystemNews() : array

Return values

array

isLoginInProgress()

Checks if login credentials have been submitted

protected isLoginInProgress(ServerRequestInterface $request) : bool

Parameters

$request : ServerRequestInterface

Return values

bool

loadStylesheets()

Load all registered stylesheets from $GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets']

protected loadStylesheets(PageRenderer $pageRenderer) : void

Parameters

$pageRenderer : PageRenderer

provideRequestTokenJwt()

protected provideRequestTokenJwt() : string

Return values

string
On this page