Skip to content

feat(2fa): allow apps to ask for the second factor again in a session - #65741

Draft
karlitschek wants to merge 1 commit into
masterfrom
feat/two-factor-challenge-requester
Draft

karlitschek wants to merge 1 commit into
masterfrom
feat/two-factor-challenge-requester

Conversation

@karlitschek

@karlitschek karlitschek commented Oct 20, 2026 •

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

One of seven small, independent core changes needed by a planned intrusion_detection app. Each can be reviewed and merged on its own:

  1. feat(security): let apps refuse requests early with request guards #65735 – request guards: let apps refuse requests early, on every entry point
  2. feat(auth): make AppPasswordCreatedEvent public and dispatch it everywhere #65736 – public AppPasswordCreatedEvent, dispatched everywhere
  3. feat(auth): allow apps to invalidate a single token #65737 – IProvider::invalidateTokenById() in the public token provider
  4. feat(sharing): dispatch an event when a share link access fails #65738 – ShareLinkAccessFailedEvent
  5. feat(security): dispatch an event when a password reset is requested #65739 – PasswordResetRequestedEvent
  6. feat(login-flow): warn when a login flow was started from another network #65740 – login flow v2 remembers where it was started and warns on another network
  7. feat(2fa): allow apps to ask for the second factor again in a session #65741 – IChallengeRequester: ask for the second factor again in a session ← this PR

TODO

  • Description by the author
  • Manual test on a live instance

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

AI disclosure: this change was written with Claude Code (claude-opus-5-5) and reviewed by the author; every commit carries an Assisted-by trailer.

🤖 Generated with Claude Code

Add IChallengeRequester. It marks the current session as needing the
second factor again, using the same mechanism as the login, so core's
two-factor middleware redirects every request of the session to the
challenge until it is solved and then returns to the given URL. Apps
can use it to confirm it is really the user before a sensitive action
in a session that looks suspicious. Sessions created with an app
password cannot answer a challenge and are refused.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
@susnux

susnux commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Sounds more like we want password confirmation with second factor instead. This just duplicates what we already have with password confirmation.

I think there is even a feature request for it

@nickvergessen nickvergessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense. But I don't see how this triggers in the server atm. Let's say e.g. a user is on Talk, this triggers "randomly" on grabbing chat messages. Which part is taking care of requiring the 2FA again? Frontend, with a hard redirect? Backend blocking all requests but being unable to redirect the user?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants