LoginController uses PageRendererBackendSetupTrait

Controller responsible for rendering the TYPO3 Backend login form.

Internal

This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.

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.html". Single LoginProviderInterface then set their template path ("Login/UserPassLoginForm" in UsernamePasswordLoginProvider), which sets Login.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
$request  : ServerRequestInterface
$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
getCurrentRequest()  : ServerRequestInterface
getLoginProviderIdentifier()  : string
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
If a login provider was chosen in the previous request, which is not the default provider, it is stored in a Cookie and appended to the HTTP Response.
checkRedirect()  : void
createLoginLogout()  : ResponseInterface
getBackendFavicon()  : string
Retrieves configured favicon for backend with fallback.
getBackendUserAuthentication()  : BackendUserAuthentication
getLanguageService()  : LanguageService
getNormalizedParams()  : NormalizedParams
getSystemNews()  : array<string|int, mixed>
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 of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the project root of the TYPO3 installation
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 read-only

protected EventDispatcherInterface $eventDispatcher

$request

Deprecated

Remove in v14 along with getCurrentRequest()

protected ServerRequestInterface $request

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

getCurrentRequest()

public getCurrentRequest() : ServerRequestInterface
Deprecated

Remove in v14 along with LoginProviderInterface->render(). Also removed $this->request property.

Return values
ServerRequestInterface

getLoginProviderIdentifier()

public getLoginProviderIdentifier() : string
Deprecated

Remove in v14 along with LoginProviderInterface->render()

Return values
string

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()

If a login provider was chosen in the previous request, which is not the default provider, it is stored in a Cookie and appended to the HTTP Response.

protected appendLoginProviderCookie(ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface
Parameters
$request : ServerRequestInterface
$response : ResponseInterface
Return values
ResponseInterface

createLoginLogout()

protected createLoginLogout(ServerRequestInterface $request, bool $loginRefresh) : ResponseInterface
Parameters
$request : ServerRequestInterface
$loginRefresh : bool

The backend triggers this with this value set when the login is close to being expired and the form needs to be redrawn.

Tags
throws
PropagateResponseException
throws
RouteNotFoundException
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<string|int, mixed>
Return values
array<string|int, mixed>

getUriForFileName()

Returns the uri of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the project root of the TYPO3 installation

protected getUriForFileName(ServerRequestInterface $request, string $filename) : string
Parameters
$request : ServerRequestInterface
$filename : string

The input filename/filepath to evaluate

Return values
string

Returns the filename of $filename if valid, otherwise blank string.

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

Search results