Skip to content

Remove handle_valid_otp method#8392

Merged
mitchellhenke merged 12 commits intomainfrom
mitchellhenke/confirmation-contexts
May 25, 2023
Merged

Remove handle_valid_otp method#8392
mitchellhenke merged 12 commits intomainfrom
mitchellhenke/confirmation-contexts

Conversation

@mitchellhenke
Copy link
Contributor

🛠 Summary of changes

Following up in what is hopefully the last series of changes for this (see #8347, #8316, #8315, #8037, #8031). Currently, the session "confirmation context" is only used by phone OTP verification, so this PR splits that specific functionality out of the shared concern and into the controller. With that, we can call handle_valid_verification_for_confirmation_context/handle_valid_verification_for_authentication_context explicitly within the 2FA controller depending on whether it is a setup controller or verification controller.

Some of the existing 2FA controllers also implemented their own version of mark_user_as_fully_authenticated to set values in the session, and this PR consolidates the behavior into the shared concern and has all of the controllers use that via handle_valid_.

handle_remember_device is not used in every authentication as we do not always present that option, so that part is left to each controller for now.

handle_valid_otp also had some logic for redirecting that was only used in one controller, so the redirect behavior was also moved back into each controller individually and called explicitly.

With these changes, we should be able to make consistent assumptions about which 2FA method was used for authentication. It will hopefully create the space to do things like keep track of verifications vs. confirmations and individual timestamps for each in the future. That will allow us to be a bit more fine-grained in terms of when we request a user to authenticate with a PIV/CAC or phishing-resistant method when an SP requests it.

@mitchellhenke mitchellhenke requested a review from aduth May 15, 2023 21:17
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/confirmation-contexts branch 7 times, most recently from 7c81390 to 9573110 Compare May 23, 2023 15:32
@mitchellhenke mitchellhenke changed the title Consolidate two factor verification and confirmation behavior Remove handle_valid_otp method May 23, 2023
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/confirmation-contexts branch from 9573110 to 7c3f1fe Compare May 23, 2023 20:16
@mitchellhenke mitchellhenke marked this pull request as ready for review May 24, 2023 20:32
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Mitchell Henke added 7 commits May 25, 2023 09:06
changelog: Internal, Two-Factor Authentication, Consolidate two factor verification and confirmation behavior
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/confirmation-contexts branch from 7c3f1fe to ae3a556 Compare May 25, 2023 14:06
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/confirmation-contexts branch 5 times, most recently from 7001a03 to b235380 Compare May 25, 2023 16:25
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/confirmation-contexts branch from b235380 to f7f3512 Compare May 25, 2023 16:28
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

🚀

@mitchellhenke mitchellhenke merged commit e370759 into main May 25, 2023
@mitchellhenke mitchellhenke deleted the mitchellhenke/confirmation-contexts branch May 25, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants