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
$authInfo
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 GeneralUtility::getIndpEnv()
method.
The following example shows how to retrieve the PSR-7 Request in the
initAuth()
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();
}
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 $authInfo
array, which is handed over
to the initAuth()
method.