Bug #98372
closedRedirect ”Defined by Domain entries“ does not work
100%
Description
According to the docs I added typoscript plugin.tx_felogin_login.domains = sub.domain.xyz and set that redirect mode (I also added get parameter ?referer=https://sub.domain.xyz/path/ to the url). Did not work.
The only way I could get it working was:
- Create a page and set is site root
- Create a site configuration and insert the domain under which the redirect should work
- Use referer as redirect mode
Updated by Torben Hansen over 1 year ago
- Related to Bug #100215: Redirect by redirectMode "refererDomains" is broken added
Updated by Torben Hansen 10 months ago
- Assignee set to Torben Hansen
This is actually expected behavior, since the redirect URL for the "Defined by Domain" setting must be known to TYPO3 (either the current domain or a domain which in configured as site). I will update the docs accordingly.
Updated by Gerrit Code Review 10 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82533
Updated by Gerrit Code Review 10 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82572
Updated by Torben Hansen 10 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 77d284daa7cbed6150ab24499b4c1e815b153bb4.
Updated by Bernhard Eckl 10 months ago
Okay, but why is that expected?
In my case I have an external intranet application on a subdomain, the intranet application checks the TYPO3 login and if I am not logged in I get redirected to the login page with ?redirect_url=https://intranet.domain.tld parameter. This worked without extra site configuration before. Now it is needed.
Updated by Torben Hansen 10 months ago
As fas as I can see, it should always have worked that way (see old legacy plugin https://github.com/TYPO3/typo3/blob/9.5/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php#L1040). There it is checked, if the given redirect URL either is:
- is a relative path (e.g. /foo/bar/
)
- is the same as the current hostname
- is known to TYPO3 (either entry in sites or a sys_domain
record exist)
So if this has somehow worked before, I think you maybe had a sys_domain
for that domain?
However, I have plans to add a PSR-14 event for TYPO3 v13 for the redirectUrl validation, so the described scenario is possible. This may be helpful, when TYPO3 is the SSO system for external applications. Current workaround is to create a plugin, which handles the redirect. You can then add a redirectUrl to ext:felogin, which redirects to the page with your redirect plugin, which then finally handles the redirect to an external page.