Skip to content

Commit 3dd0b36

Browse files
docs(auth): clarify WebAuthn login chain sequencing and security ordering reqs
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 9cbdf62 commit 3dd0b36

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

lib/private/Authentication/Login/WebAuthnChain.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
*/
99
namespace OC\Authentication\Login;
1010

11+
/**
12+
* Orchestrates the WebAuthn (passkeys/security keys) login command chain in a
13+
* security-sensitive order for interactive authentication.
14+
*
15+
* Mirrors the main login-chain {@see Chain} with adaptations to the
16+
* WebAuthn-specific authentication flow (i.e., no pre-login hook or Flow v2
17+
* ephemeral-session step).
18+
*/
1119
class WebAuthnChain {
1220
public function __construct(
1321
private UserDisabledCheckCommand $userDisabledCheckCommand,
@@ -23,17 +31,28 @@ public function __construct(
2331
) {
2432
}
2533

34+
/**
35+
* Runs the WebAuthn login pipeline for one login attempt.
36+
*/
2637
public function process(LoginData $loginData): LoginResult {
38+
// Phase 1: pre-auth eligibility checks
2739
$chain = $this->userDisabledCheckCommand;
2840
$chain
41+
// Phase 2: primary authentication and login-state transition
2942
->setNext($this->webAuthnLoginCommand)
3043
->setNext($this->loggedInCheckCommand)
3144
->setNext($this->completeLoginCommand)
45+
46+
// Phase 3: session strategy and token materialization
3247
->setNext($this->createSessionTokenCommand)
48+
49+
// Phase 4: post-auth maintenance and context updates
3350
->setNext($this->clearLostPasswordTokensCommand)
3451
->setNext($this->updateLastPasswordConfirmCommand)
3552
->setNext($this->setUserTimezoneCommand)
36-
->setNext($this->twoFactorCommand)
53+
54+
// Phase 5: assurance/finalization gates
55+
->setNext($this->twoFactorCommand) // before remembered-login finalization
3756
->setNext($this->finishRememberedLoginCommand);
3857

3958
return $chain->process($loginData);

0 commit comments

Comments
 (0)