‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator:
TYPO3\CMS\Core\Middleware\BackendUserAuthenticator

Public Member Functions

 __construct (Context $context, LanguageServiceFactory $languageServiceFactory, RateLimiterFactory $rateLimiterFactory)
 
 process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Middleware\BackendUserAuthenticator
 __construct (protected Context $context)
 

Protected Member Functions

 enrichResponseWithHeadersAndCookieInformation (ServerRequestInterface $request, ResponseInterface $response, ?BackendUserAuthentication $userAuthentication)
 
 sessionGarbageCollection ()
 
 redirectToMfaEndpoint (string $endpoint, BackendUserAuthentication $user, ServerRequestInterface $request, array $parameters=[])
 
bool isLoggedInBackendUserRequired (Route $route)
 
 ensureLoginRateLimit (BackendUserAuthentication $user, ServerRequestInterface $request)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Middleware\BackendUserAuthenticator
ResponseInterface applyHeadersToResponse (ResponseInterface $response)
 
 setBackendUserAspect (?BackendUserAuthentication $user, int $alternativeWorkspaceId=null)
 

Protected Attributes

array $publicRoutes
 

Private Attributes

LanguageServiceFactory $languageServiceFactory
 
RateLimiterFactory $rateLimiterFactory
 

Detailed Description

Initializes the backend user authentication object (BE_USER) and the global LANG object.

Definition at line 47 of file BackendUserAuthenticator.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::__construct ( Context  $context,
LanguageServiceFactory  $languageServiceFactory,
RateLimiterFactory  $rateLimiterFactory 
)

Member Function Documentation

◆ enrichResponseWithHeadersAndCookieInformation()

TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::enrichResponseWithHeadersAndCookieInformation ( ServerRequestInterface  $request,
ResponseInterface  $response,
?BackendUserAuthentication  $userAuthentication 
)
protected

Backend requests should always apply Set-Cookie information and never be cacheable. This is also needed if there is a redirect from somewhere in the code.

Exceptions

Definition at line 169 of file BackendUserAuthenticator.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\appendCookieToResponse(), TYPO3\CMS\Core\Middleware\BackendUserAuthenticator\applyHeadersToResponse(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\removeCookie().

Referenced by TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator\process().

◆ ensureLoginRateLimit()

TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::ensureLoginRateLimit ( BackendUserAuthentication  $user,
ServerRequestInterface  $request 
)
protected

◆ isLoggedInBackendUserRequired()

bool TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::isLoggedInBackendUserRequired ( Route  $route)
protected

Check if the user is required for the request. If we're trying to do a login or an ajax login, don't require a user.

Parameters
Route$route‪the Route path to check against, something like '
Returns
‪bool true when the Route requires an authenticated backend user

Definition at line 222 of file BackendUserAuthenticator.php.

References TYPO3\CMS\Backend\Routing\Route\getPath().

Referenced by TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator\process().

◆ process()

◆ redirectToMfaEndpoint()

TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::redirectToMfaEndpoint ( string  $endpoint,
BackendUserAuthentication  $user,
ServerRequestInterface  $request,
array  $parameters = [] 
)
protected

◆ sessionGarbageCollection()

TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::sessionGarbageCollection ( )
protected

Garbage collection for be_sessions (with a probability)

Definition at line 191 of file BackendUserAuthenticator.php.

References TYPO3\CMS\Core\Session\UserSessionManager\create().

Referenced by TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator\process().

Member Data Documentation

◆ $languageServiceFactory

LanguageServiceFactory TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::$languageServiceFactory
private

◆ $publicRoutes

array TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::$publicRoutes
protected
Initial value:
= [
'/login',
'/login/frame',
'/login/password-reset/forget',
'/login/password-reset/initiate-reset',
'/login/password-reset/validate',
'/login/password-reset/finish',
'/login/request-token',
'/install/server-response-check/host',
'/ajax/login',
'/ajax/logout',
'/ajax/login/preflight',
'/ajax/login/refresh',
'/ajax/login/timedout',
]

List of requests that don't need a valid BE user

Definition at line 54 of file BackendUserAuthenticator.php.

◆ $rateLimiterFactory

RateLimiterFactory TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator::$rateLimiterFactory
private