Repository navigation
fix(step-up): let a new factor be followed by another in the same sign-in - #627
Merged
Merged
Conversation
…n-in Enrollment asked for a step-up whenever the account had a passkey or TOTP, including one added in the current session, which a step-up refuses. A new user was stopped between their first passkey and their recovery codes. Only a factor from before the sign-in now asks for a step-up.
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.
Fixes a sign-up dead end in 0.24.0.
Since 0.24.0, factor enrollment (passkey, TOTP, phone and recovery codes) asks for a fresh step-up when the account has a passkey or TOTP, and a step-up only accepts a factor enrolled before the session signed in. The enrollment check counted every factor, including one added in the current session. A new user who signed in with a code and added a first passkey was then asked for a step-up that nothing could pass, so the hosted sign-up stopped at the recovery codes page until the user signed in again.
requireFactorEnrollmentProofnow counts only passkeys created, and TOTPs verified, before the session's sign-in, using the same sign-in time the step-up check uses.Tests: unit tests for the query and the fallback, and a Postgres spec that generates recovery codes right after a first passkey and right after a first TOTP (both answered
403 step_up_requiredbefore this change), and still requires a step-up once the passkey predates the sign-in. Found by the OpenID Provider conformance run, whose device-flow sign-up stops on the recovery codes page against 0.24.0.Released as a patch.