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

Public Member Functions

 __construct (protected Context $context)
 
 process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 

Protected Member Functions

ResponseInterface applyHeadersToResponse (ResponseInterface $response)
 
 setBackendUserAspect (?BackendUserAuthentication $user, int $alternativeWorkspaceId=null)
 

Detailed Description

Boilerplate to authenticate a backend user in the current workflow, can be used for TYPO3 Backend and Frontend requests.

The actual authentication and the selection if no-cache headers to responses should be applied should still reside in the "process()" method which should be extended by derivative classes.

In derivative classes, the Context API can be used to detect, if a backend user is logged in like this:

$response = $handler->handle($request);
if ($this->context->getAspect('backend.user')->isLoggedIn()) {
return $this->‪applyHeadersToResponse($response);
}

this class might get merged again with the subclasses

Definition at line 50 of file BackendUserAuthenticator.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Middleware\BackendUserAuthenticator::__construct ( protected Context  $context)

Definition at line 52 of file BackendUserAuthenticator.php.

Member Function Documentation

◆ applyHeadersToResponse()

ResponseInterface TYPO3\CMS\Core\Middleware\BackendUserAuthenticator::applyHeadersToResponse ( ResponseInterface  $response)
protected

Adding headers to the response to avoid caching on the client side. These headers will override any previous headers of these names sent. Get the http headers to be sent if an authenticated user is available, in order to disallow browsers to store the response on the client side.

Returns
‪ResponseInterface the modified response object.

Definition at line 64 of file BackendUserAuthenticator.php.

Referenced by TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator\enrichResponseWithHeadersAndCookieInformation(), TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\process(), and TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator\redirectToMfaEndpoint().

◆ process()

TYPO3\CMS\Core\Middleware\BackendUserAuthenticator::process ( ServerRequestInterface  $request,
RequestHandlerInterface  $handler 
)
abstract

◆ setBackendUserAspect()

TYPO3\CMS\Core\Middleware\BackendUserAuthenticator::setBackendUserAspect ( ?BackendUserAuthentication  $user,
int  $alternativeWorkspaceId = null 
)
protected
‪TYPO3\CMS\Core\Middleware\BackendUserAuthenticator\applyHeadersToResponse
‪ResponseInterface applyHeadersToResponse(ResponseInterface $response)
Definition: BackendUserAuthenticator.php:64