Review main Merged

95284[TASK] Authenticate users via the auth pipeline

Benni Mack CR +2 V +2 Expert +1190 −156 updated 11/10/26, 18:09

Commit message

The backend and frontend user authentication middlewares now resolve
their requests through the authentication pipeline contracts of
EXT:core: they ask the AuthenticatorManager to authenticate the
request for the backend realm or the frontend realm of the site. The
authentication of backend users in frontend requests (preview, admin
panel) is not changed and moves to the pipeline with the native session
authenticator.

The legacy authentication service chain is wrapped into the pipeline
authenticators LegacyBackendAuthenticator and
LegacyFrontendAuthenticator, registered for the backend and the
frontend realm, so every existing authentication service and the
established login behavior keep working unchanged, including the login
rate limit and parameter-triggered login ("logintype=login") on any
frontend page.

In the backend, a pending multi-factor authentication requirement is
expressed as a Challenge outcome, whose response redirects to the MFA
route or answers with 401 for AJAX calls, as before. The established
legacy user object is handed over as "legacyUser" attribute of the
Authenticated outcome, which the middleware prefers over the global. On
successful authentication the established Principal is provided as
"backend.principal" or "frontend.principal" request attribute. As in
the frontend, the backend authenticator resolves the group data of the
user before it establishes the principal, so the principal of the
outcome is complete and used as it is; the backend login
initialization no longer resolves the group data a second time. All
new classes are internal.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Josua Vogel +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Josua Vogel +1
    • core-ci +1 CI

Issues 3

Files 12

Review log 3454

Show 1629 earlier messages
  1. Benni Mack uploaded patch set 1 08/12/26, 11:34

  2. core-ci voted on patch set 1 V -1 08/12/26, 11:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106514

  3. Benni Mack rebased onto patch set 2 V -1 08/12/26, 12:05

  4. Benni Mack uploaded patch set 3 08/12/26, 12:08

  5. core-ci voted on patch set 2 V -1 08/12/26, 12:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106523

  6. core-ci voted on patch set 3 V -1 08/12/26, 12:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106529

  7. Benni Mack rebased onto patch set 4 V -1 10/05/26, 17:00

  8. core-ci voted on patch set 4 V -1 10/05/26, 17:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110132

  9. Benni Mack uploaded patch set 5 V -1 10/05/26, 18:16

  10. core-ci voted on patch set 5 V +1 10/05/26, 18:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110141

  11. Benni Mack uploaded patch set 6 V +1 10/06/26, 04:50

  12. core-ci voted on patch set 6 V -1 10/06/26, 05:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110170

  13. Benni Mack rebased onto patch set 7 V -1 10/06/26, 05:53

  14. core-ci voted on patch set 7 V +1 10/06/26, 06:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110181

  15. Benni Mack rebased onto patch set 8 V +1 10/06/26, 08:11

  16. core-ci voted on patch set 8 V +1 10/06/26, 08:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110203

  17. Simon Schaufelberger commented on patch set 8 10/06/26, 18:47

    I'm happy to see progress in that area of TYPO3! I would like to know: Is that concept built upon a standard or implemented only for TYPO3? I'm just thinking if it would be compatible to plug in third party auth providers easily like the ones from https://github.com/thephpleague/oauth2-client ? I'm not sure how Symfony is doing that because we already use a lot of components from them. Do you know how they do auth? It would also be good to reduce the number of auth extensions in the TER https://extensions.typo3.org/?L=0&id=1&tx_solr%5Bq%5D=auth and finally build a good foundation that most of them are not needed anymore.
  18. Oli Bartsch uploaded patch set 9 V +1 10/09/26, 10:18

  19. Oli Bartsch commented on patch set 9 10/09/26, 10:24

    This change is ready for review.

    Reply

    The design follows the authenticator model of Symfony and Laravel but stays PSR-7/PSR-15 native instead of adopting Symfony Security, so a provider built on league/oauth2-client plugs in as an AuthenticatorInterface implementation. An OIDC login on top of it is planned for a later phase.
  20. core-ci voted on patch set 9 V -1 10/09/26, 10:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110580

  21. Oli Bartsch rebased onto patch set 10 V -1 10/09/26, 13:01

  22. Oli Bartsch uploaded patch set 11 10/09/26, 13:03

  23. core-ci voted on patch set 11 V +1 10/09/26, 13:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110609

  24. core-ci voted on patch set 10 V +1 10/09/26, 13:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110606

  25. Oli Bartsch rebased onto patch set 12 V +1 10/09/26, 20:49

  26. core-ci voted on patch set 12 V +1 10/09/26, 21:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110719

  27. Oli Bartsch uploaded patch set 13 V +1 10/12/26, 12:32

  28. Markus Klein commented on patch set 13 10/12/26, 12:41

    Reply

    @bo@cedev.de Regarding OIDC: I would be honored if you could keep me in the loop here. Reason: I don't wanna invest time into ext:oidc if this is going to be superseded then anyways. Besides that: I'm currently one step away to try getting all current Oauth2 extension maintainers onto a table. We have so much duplicate code out there that it would be beneficial to have that burden on less shoulders than currently. Of course, if we manage to get some of the basics into Core, that's would be even better. Let me know, what your ideas are. Thanks.
  29. core-ci voted on patch set 13 V +1 10/12/26, 12:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110905

  1. Oli Bartsch rebased onto patch set 14 V +1 10/12/26, 19:57

  2. core-ci voted on patch set 14 V +1 10/12/26, 20:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110941

  3. Benjamin Franzke commented on patch set 14 10/23/26, 12:55

    BackendUserAuthenticator.php:136

    It feels like we should differentiate between an intermediate `Principal` that is provided by `AuthenticatorInterface->authenticate()` and the kind of `Principal` that built here and **derived** from the original (i call it intermediate) `Principal` and the resolved group data. (If you remember: Otherwise it's similar to our `new Locale('de')` case create by `SiteLanguage` which is incomplete and needs to be recreated later)
  4. Benni Mack uploaded patch set 15 V +1 10/25/26, 13:55

  5. core-ci voted on patch set 15 V +1 10/25/26, 14:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112494

  6. Oliver Klee voted on patch set 15 V +1 10/25/26, 14:52

  7. Oli Bartsch uploaded patch set 16 V +1 10/25/26, 19:39

  8. core-ci voted on patch set 16 V +1 10/25/26, 20:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112538

  9. Benni Mack uploaded patch set 17 V +1 10/26/26, 19:41

  10. Benni Mack commented on patch set 17 10/26/26, 19:42

    BackendUserAuthenticator.php:136 Reply

    The backend authenticators now resolve the group data before they establish the principal, as the frontend did already, so the principal of the outcome is the final one and the middleware no longer rebuilds it. Your remark helped shape that process now better.
  11. core-ci voted on patch set 17 V +1 10/26/26, 19:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112605

  12. Oliver Klee voted on patch set 17 V +1 10/26/26, 21:09

  13. Oli Bartsch uploaded patch set 18 V +1 10/29/26, 17:23

  14. Oli Bartsch voted on patch set 18 CR +1 V +1 10/29/26, 17:26

  15. core-ci voted on patch set 18 V +1 10/29/26, 17:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112803

  16. Benni Mack commented on patch set 18 10/30/26, 22:50

    BackendUserAuthenticator.php:136 Reply

    Thought about it again and I'm still not 100% happy with it (mainly because we mix group resolving still and identity management). However, I'd like to this in a followup once Authorization chain is also prepared. Would this be OK for you now and we will add this as a followup?
  17. Benni Mack uploaded patch set 19 CR +1 V +1 11/03/26, 14:43

  18. core-ci voted on patch set 19 V +1 11/03/26, 15:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113161

  19. Benjamin Franzke commented on patch set 19 11/06/26, 14:26

    BackendUserAuthenticator.php:136 Reply

    yup, fine by me. thanks!
  20. Benni Mack rebased onto patch set 20 V +1 11/09/26, 10:12

  21. core-ci voted on patch set 20 V +1 11/09/26, 10:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113637

  22. Josua Vogel voted on patch set 20 CR +1 V +1 11/10/26, 15:25

  23. Georg Ringer voted on patch set 20 CR +1 V +1 11/10/26, 18:07

  24. Benni Mack voted on patch set 20 CR +2 V +2 11/10/26, 18:09

  25. Benni Mack merged patch set 21 11/10/26, 18:09