#99311Add a redirect option in FrontendUserAuthenticator Middleware
Description
Using a custom oAuth2 Login, i tried to create a login via Discord. I set the logintype, then i created my Authentication Service, everything worked great. What i missed though is the redirect option. Once the TYPO3\CMS\Frontend\Middleware\FrontendUserAuthenticator kicks in and once the login is successful, the middleware just returns the response, without the option to redirect somewhere.
What i am thinking of as an MVP, is maybe a redirect GET parameter which is going to be validated just before the returned response. If it is there, then return the response with an extra Location: header. Maybe something like that:
if (count($request->getQueryParams()) > 0 && array_key_exists('redirect', $request->getQueryParams()))
$response = $this->responseFactory->createResponse()
->withHeader('Location', $request->getQueryParams()['redirect']);
return $response;
}
After the MVP, i am thinking of maybe a redirect which is generated via a pid. Instead of passing a whole URL in the redirect parameter, maybe a PID could be passed and then the Middleware could resolve this pid.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 6
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2023-04-05T09:54:50+00:00" > 04/05/23, 09:54 </span>
-
Georg Ringer changed assigned to Benni Mack <span data-processor="relativetime" data-value="2024-07-10T07:57:43+00:00" > 07/10/24, 07:57 </span>
-
Benni Mack changed category <span data-processor="relativetime" data-value="2024-12-11T14:49:19+00:00" > 12/11/24, 14:49 </span>
-
Benni Mack changed removed the assignee <span data-processor="relativetime" data-value="2025-03-28T08:32:12+00:00" > 03/28/25, 08:32 </span>
-
Benni Mack commented and changed status
NewRejected <span data-processor="relativetime" data-value="2025-04-11T10:37:35+00:00" > 04/11/25, 10:37 </span>Hey,
I will close this. If this is implemented in Core, we need to harden this. The solution from you is an effective “Open Redirect” Vulnerability https://cwe.mitre.org/data/definitions/601.html – This should not be shipped in Core.
If you are using OpenID Connect, consider using https://extensions.typo3.org/extension/oidc (latest master version on github)