Repository navigation
stages/authenticator_validate: refactor authenticator validation stage to prevent cross-device-type response validation as well as allow multiple devices of the same type - #22369
Open
atereshkin wants to merge 4 commits into
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #22369 +/- ##
==========================================
- Coverage 93.28% 92.28% -1.00%
==========================================
Files 1032 1040 +8
Lines 60052 60294 +242
Branches 400 400
==========================================
- Hits 56018 55643 -375
- Misses 4034 4651 +617
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…to prevent cross-device-type response validation as well as allow mutiple devices of the same type
…led validation when a user is known (fix for goauthentik#21832)
…n submitting challenge response
atereshkin
force-pushed
the
authenticator-validation-per-device
branch
from
May 15, 2026 08:00
9ad3e56 to
c821ccc
Compare
3 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
At the heart of this change is the introduction of a "device challenger" hierarchy (parallel to device hierarchy) to codify the challenge lifecycle behaviors (generate -> initiate (send) -> validate). I am not sure "challenger" is a great name, but introducing yet another thing called "lifecycle" didn't seem like good idea and "validator" is too narrow. The main advantage this gives, other than tidier code organization and more explicit data flow, is the ability to control for each device type individually whether we issue a challenge per-device or a single challenge for the entire device type. That way we can allow the user to have multiple phone numbers attached (#6732) while still checking every TOTP device at once.
It also eliminates the previously existing but undesirable behavior of validating challenge responses across different authenticator device types.
Additionally, the server no longer trusts the client about any properties of the challenge. The server looks that up in the flow context by the challenge uid that the client has selected.
This alters the behavior of the authenticator validation stage with respect to
login_failedsignal: the signal is now sent on every validation error as long as a user is known (either we are validating second factor or we have determined the device during validation). Previously this was inconsistent across device types and there was no signal if e.g. an error was caught earlier in the validation (e.g. empty code supplied).Checklist
ak test authentik/)make lint-fix)make gen)make web)Closes #25265