Feature: #100116 - Make PSR-7 request accessible for authentication services
See forge#100116
Description
Authentication services can now access the PSR-7 request object via the
$auth
array. Previously, custom TYPO3 authentication services
did not have direct access to the object and therefore had to either
use PHP super globals or TYPO3's General
method.
The following example shows how to retrieve the PSR-7 request in the
init
method of a custom authentication service:
public function initAuth($mode, $loginData, $authInfo, $pObj)
{
/** @var ServerRequestInterface $request */
$request = $authInfo['request'];
/** @var NormalizedParams $normalizedParams */
$normalizedParams = $request->getAttribute('normalizedParams');
$isHttps = $normalizedParams->isHttps();
}
Copied!
Impact
Custom TYPO3 authentication services can now directly access the PSR-7
request object from the authentication process. It is available via the
request
key of the $auth
array, which is handed over
to the init
method.