Review main Merged

95036[TASK] Add functional tests for user authentication chain

Benni Mack CR +2 V +2 Hard +344 −0 updated 08/01/26, 05:11

Commit message

The central authentication logic in
AbstractUserAuthentication::checkAuthentication() is now covered
by functional tests, pinning down the current behavior of:

* the authentication service chain return code protocol, including
  the chain not being stopped for return codes between 1 and 99,
* user records provided by custom getUser services (SSO pattern),
* the request token gate aborting active logins,
* session creation, re-use on subsequent requests,
* MFA evaluation raising MfaRequiredException while keeping the
  created user session unmarked as MFA-verified.

A configurable fixture authentication service is registered through
the regular service chain registration to characterize the chain
semantics against the core authentication service.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1215

  1. Benni Mack uploaded patch set 1 07/31/26, 10:26

  2. Benni Mack updated the commit message in patch set 2 07/31/26, 10:26

  3. core-ci voted on patch set 1 V +1 07/31/26, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105749

  4. core-ci voted on patch set 2 V +1 07/31/26, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105750

  5. Benni Mack marked it ready for review 07/31/26, 11:13

  6. Simon Schaufelberger commented on patch set 2 07/31/26, 13:11

    FixtureAuthenticationService.php:43

    why this mix of static and non static method calls? why is getUser and authUser not static while this one is?
  7. Oliver Klee commented on patch set 2 V +1 07/31/26, 13:48

    AbstractUserAuthenticationTest.php:76

    This is not necessary as the functional tests are configured to backup and restore globals: https://github.com/TYPO3/typo3/blob/main/Build/phpunit/FunctionalTests.xml#L17
  8. Benni Mack uploaded patch set 3 V +1 07/31/26, 19:18

  9. Benni Mack commented on patch set 3 07/31/26, 19:20

    AbstractUserAuthenticationTest.php:76 Reply

    thx. done. I have a fork of the TF working against (I'm trying to add more speed to it), so I had some workarounds while doing this patch.

    FixtureAuthenticationService.php:43 Reply

    that's by design, see the tests, I need to know which auth service is called and why and how often.
  10. Garvin Hicking voted on patch set 3 CR +1 V +1 07/31/26, 19:25

  11. core-ci voted on patch set 3 V +1 07/31/26, 19:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105758

  12. Simon Schaufelberger voted on patch set 3 CR +1 V +1 07/31/26, 19:57

  13. Oliver Klee voted on patch set 3 V +1 07/31/26, 20:38

  14. Benni Mack voted on patch set 3 CR +2 V +2 08/01/26, 05:10

  15. Benni Mack merged patch set 4 08/01/26, 05:11