Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ def post_analytics(result)
end
end

def sign_up_mfa_selection_order_bucket
return unless in_multi_mfa_selection_flow?
@sign_up_mfa_selection_order_bucket = AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
end

def analytics_properties
parsed_phone = Phonelib.parse(phone)

Expand All @@ -165,7 +160,6 @@ def analytics_properties
phone_configuration_id: phone_configuration&.id,
in_multi_mfa_selection_flow: in_multi_mfa_selection_flow?,
enabled_mfa_methods_count: mfa_context.enabled_mfa_methods_count,
sign_up_mfa_priority_bucket: sign_up_mfa_selection_order_bucket,
}
end

Expand Down
11 changes: 1 addition & 10 deletions app/controllers/users/backup_code_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ def index
def create
generate_codes
result = BackupCodeSetupForm.new(current_user).submit
analytics_properties = result.to_h.merge(
sign_up_mfa_selection_order_bucket:
sign_up_mfa_selection_order_bucket,
)
analytics_properties = result.to_h
analytics.backup_code_setup_visit(**analytics_properties)
irs_attempts_api_tracker.mfa_enroll_backup_code(success: result.success?)

Expand Down Expand Up @@ -79,7 +76,6 @@ def mfa_user
def track_backup_codes_confirmation_setup_visit
analytics.multi_factor_auth_enter_backup_code_confirmation_visit(
enabled_mfa_methods_count: mfa_user.enabled_mfa_methods_count,
sign_up_mfa_selection_order_bucket: sign_up_mfa_selection_order_bucket,
)
end

Expand All @@ -93,11 +89,6 @@ def generate_codes
user_session[:backup_codes] = @codes
end

def sign_up_mfa_selection_order_bucket
return unless in_multi_mfa_selection_flow?
AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
end

def set_backup_code_setup_presenter
@presenter = SetupPresenter.new(
current_user: current_user,
Expand Down
11 changes: 2 additions & 9 deletions app/controllers/users/mfa_selection_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@ class MfaSelectionController < ApplicationController
def index
two_factor_options_form
@after_setup_path = after_mfa_setup_path
@sign_up_mfa_selection_order_bucket = AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
@presenter = two_factor_options_presenter
analytics.user_registration_2fa_additional_setup_visit(
sign_up_mfa_priority_bucket: @sign_up_mfa_selection_order_bucket,
)
analytics.user_registration_2fa_additional_setup_visit
end

def update
result = submit_form
@sign_up_mfa_selection_order_bucket = AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
analytics_hash = result.to_h.merge(
sign_up_mfa_priority_bucket: @sign_up_mfa_selection_order_bucket,
)
analytics_hash = result.to_h
analytics.user_registration_2fa_additional_setup(**analytics_hash)

if result.success?
Expand All @@ -45,7 +39,6 @@ def submit_form
def two_factor_options_presenter
TwoFactorOptionsPresenter.new(
user_agent: request.user_agent,
priority_bucket: @sign_up_mfa_selection_order_bucket,
user: current_user,
phishing_resistant_required: service_provider_mfa_policy.phishing_resistant_required?,
piv_cac_required: service_provider_mfa_policy.piv_cac_required?,
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/users/phone_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,10 @@ def recaptcha_enabled?
FeatureManagement.phone_recaptcha_enabled?
end

def sign_up_mfa_selection_order_bucket
return unless in_multi_mfa_selection_flow?
AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
end

def track_phone_setup_visit
mfa_user = MfaContext.new(current_user)
analytics.user_registration_phone_setup_visit(
enabled_mfa_methods_count: mfa_user.enabled_mfa_methods_count,
sign_up_mfa_selection_order_bucket: sign_up_mfa_selection_order_bucket,
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ def track_piv_cac_setup_visit
)
end

def sign_up_mfa_selection_order_bucket
return unless in_multi_mfa_selection_flow?
AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
end

def remove_piv_cac
revoke_remember_device(current_user)
current_user_id = current_user.id
Expand Down Expand Up @@ -170,7 +165,6 @@ def analytics_properties
{
in_multi_mfa_selection_flow: in_multi_mfa_selection_flow?,
enabled_mfa_methods_count: mfa_context.enabled_mfa_methods_count,
sign_up_mfa_selection_order_bucket: sign_up_mfa_selection_order_bucket,
}
end

Expand Down
7 changes: 0 additions & 7 deletions app/controllers/users/totp_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,12 @@ def set_totp_setup_presenter
)
end

def sign_up_mfa_selection_order_bucket
return unless in_multi_mfa_selection_flow?
@sign_up_mfa_selection_order_bucket = AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
end

def track_event
mfa_user = MfaContext.new(current_user)
analytics.totp_setup_visit(
user_signed_up: MfaPolicy.new(current_user).two_factor_enabled?,
totp_secret_present: new_totp_secret.present?,
enabled_mfa_methods_count: mfa_user.enabled_mfa_methods_count,
sign_up_mfa_selection_order_bucket: sign_up_mfa_selection_order_bucket,
)
end

Expand Down Expand Up @@ -144,7 +138,6 @@ def current_auth_app_count
def analytics_properties
{
in_multi_mfa_selection_flow: in_multi_mfa_selection_flow?,
sign_up_mfa_selection_order_bucket: sign_up_mfa_selection_order_bucket,
pii_like_keypaths: [[:mfa_method_counts, :phone]],
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ class TwoFactorAuthenticationSetupController < ApplicationController

def index
two_factor_options_form
@sign_up_mfa_selection_order_bucket = AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
@presenter = two_factor_options_presenter
analytics.user_registration_2fa_setup_visit(
sign_up_mfa_priority_bucket: @sign_up_mfa_selection_order_bucket,
)
analytics.user_registration_2fa_setup_visit
end

def create
result = submit_form
@sign_up_mfa_selection_order_bucket = AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
analytics_hash = result.to_h.merge(
sign_up_mfa_priority_bucket: @sign_up_mfa_selection_order_bucket,
)
analytics_hash = result.to_h
analytics.user_registration_2fa_setup(**analytics_hash)
irs_attempts_api_tracker.mfa_enroll_options_selected(
success: result.success?,
Expand Down Expand Up @@ -49,7 +43,6 @@ def submit_form
def two_factor_options_presenter
TwoFactorOptionsPresenter.new(
user_agent: request.user_agent,
priority_bucket: @sign_up_mfa_selection_order_bucket,
user: current_user,
phishing_resistant_required: service_provider_mfa_policy.phishing_resistant_required?,
piv_cac_required: service_provider_mfa_policy.piv_cac_required?,
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/users/webauthn_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ def set_webauthn_setup_presenter
)
end

def sign_up_mfa_selection_order_bucket
return unless in_multi_mfa_selection_flow?
@sign_up_mfa_selection_order_bucket = AbTests::SIGN_UP_MFA_SELECTION.bucket(current_user.uuid)
end

def flash_error(errors)
flash.now[:error] = errors.values.first.first
end
Expand Down Expand Up @@ -178,7 +173,6 @@ def process_valid_webauthn(form)
def analytics_properties
{
in_multi_mfa_selection_flow: in_multi_mfa_selection_flow?,
sign_up_mfa_selection_order_bucket: sign_up_mfa_selection_order_bucket,
}
end

Expand Down
17 changes: 4 additions & 13 deletions app/presenters/two_factor_options_presenter.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
class TwoFactorOptionsPresenter
include ActionView::Helpers::TranslationHelper

attr_reader :user, :priority_bucket
attr_reader :user

def initialize(user_agent:, user: nil, priority_bucket: :default,
def initialize(user_agent:, user: nil,
phishing_resistant_required: false, piv_cac_required: false)
@user_agent = user_agent
@user = user
@priority_bucket = priority_bucket
@phishing_resistant_required = phishing_resistant_required
@piv_cac_required = piv_cac_required
end

def options
if priority_bucket == :authentication_app_priority
totp_option + webauthn_platform_option + webauthn_option + piv_cac_option +
phone_options + backup_code_option
elsif priority_bucket == :usability_priority
phone_options + totp_option + backup_code_option + webauthn_platform_option +
webauthn_option + piv_cac_option
else
webauthn_platform_option + webauthn_option + piv_cac_option + totp_option +
phone_options + backup_code_option
end
totp_option + phone_options + webauthn_platform_option +
backup_code_option + webauthn_option + piv_cac_option
end

def icon
Expand Down
16 changes: 2 additions & 14 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3608,30 +3608,24 @@ def user_prompted_before_navigation_and_still_on_page(path:, seconds:, **extra)

# @param [Boolean] success
# @param [Hash] errors
# @param [String] sign_up_mfa_priority_bucket
# Tracks when the the user has selected and submitted additional MFA methods on user registration
def user_registration_2fa_additional_setup(success:,
sign_up_mfa_priority_bucket:,
errors: nil,
**extra)
track_event(
'User Registration: Additional 2FA Setup',
{
success: success,
sign_up_mfa_priority_bucket: sign_up_mfa_priority_bucket,
errors: errors,
**extra,
}.compact,
)
end

# Tracks when user visits additional MFA selection page
# @param [String] sign_up_mfa_priority_bucket
def user_registration_2fa_additional_setup_visit(sign_up_mfa_priority_bucket:, **extra)
def user_registration_2fa_additional_setup_visit
track_event(
'User Registration: Additional 2FA Setup visited',
sign_up_mfa_priority_bucket: sign_up_mfa_priority_bucket,
**extra,
)
end

Expand All @@ -3640,11 +3634,9 @@ def user_registration_2fa_additional_setup_visit(sign_up_mfa_priority_bucket:, *
# @param [Integer] enabled_mfa_methods_count
# @param [Integer] selected_mfa_count
# @param ['voice', 'auth_app'] selection
# @param [String] sign_up_mfa_priority_bucket
# Tracks when the the user has selected and submitted MFA auth methods on user registration
def user_registration_2fa_setup(
success:,
sign_up_mfa_priority_bucket:,
errors: nil,
selected_mfa_count: nil,
enabled_mfa_methods_count: nil,
Expand All @@ -3658,20 +3650,16 @@ def user_registration_2fa_setup(
errors: errors,
selected_mfa_count: selected_mfa_count,
enabled_mfa_methods_count: enabled_mfa_methods_count,
sign_up_mfa_priority_bucket: sign_up_mfa_priority_bucket,
selection: selection,
**extra,
}.compact,
)
end

# Tracks when user visits MFA selection page
# @param [String] sign_up_mfa_priority_bucket
def user_registration_2fa_setup_visit(sign_up_mfa_priority_bucket:, **extra)
def user_registration_2fa_setup_visit
track_event(
'User Registration: 2FA Setup visited',
sign_up_mfa_priority_bucket: sign_up_mfa_priority_bucket,
**extra,
)
end

Expand Down
1 change: 0 additions & 1 deletion config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ session_timeout_warning_seconds: 150
session_total_duration_timeout_in_minutes: 720
ses_configuration_set_name: ''
set_remember_device_session_expiration: false
sign_up_mfa_selection_order_testing: '{ "default": 100, "authentication_app_priority": 0, "usability_priority": 0 }'
sp_handoff_bounce_max_seconds: 2
show_user_attribute_deprecation_warnings: false
otp_min_attempts_remaining_warning_count: 3
Expand Down
5 changes: 0 additions & 5 deletions config/initializers/ab_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ def self.in_person_cta_variant_testing_buckets
buckets
end

SIGN_UP_MFA_SELECTION = AbTestBucket.new(
experiment_name: 'MFA selection order: Auth app first',
buckets: IdentityConfig.store.sign_up_mfa_selection_order_testing,
)

IN_PERSON_CTA = AbTestBucket.new(
experiment_name: 'In-Person Proofing CTA',
buckets: in_person_cta_variant_testing_buckets,
Expand Down
4 changes: 0 additions & 4 deletions lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,6 @@ def self.build_store(config_map)
config.add(:ses_configuration_set_name, type: :string)
config.add(:set_remember_device_session_expiration, type: :boolean)
config.add(:show_user_attribute_deprecation_warnings, type: :boolean)
config.add(
:sign_up_mfa_selection_order_testing, type: :json,
options: { symbolize_names: true }
)
config.add(:skip_encryption_allowed_list, type: :json)
config.add(:sp_handoff_bounce_max_seconds, type: :integer)
config.add(:state_tracking_enabled, type: :boolean)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
enabled_mfa_methods_count: 1,
in_multi_mfa_selection_flow: true,
sign_up_mfa_priority_bucket: :default,
}

expect(@analytics).to receive(:track_event).
Expand Down Expand Up @@ -133,7 +132,6 @@
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
enabled_mfa_methods_count: 1,
in_multi_mfa_selection_flow: true,
sign_up_mfa_priority_bucket: :default,
}

stub_analytics
Expand Down Expand Up @@ -201,7 +199,6 @@
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
enabled_mfa_methods_count: 1,
in_multi_mfa_selection_flow: true,
sign_up_mfa_priority_bucket: :default,
}

stub_analytics
Expand Down Expand Up @@ -265,7 +262,6 @@
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
enabled_mfa_methods_count: 1,
in_multi_mfa_selection_flow: true,
sign_up_mfa_priority_bucket: :default,
}

stub_analytics
Expand Down Expand Up @@ -446,7 +442,6 @@
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
enabled_mfa_methods_count: 1,
in_multi_mfa_selection_flow: true,
sign_up_mfa_priority_bucket: :default,
}

expect(@analytics).to receive(:track_event).
Expand Down Expand Up @@ -532,7 +527,6 @@
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
enabled_mfa_methods_count: 1,
in_multi_mfa_selection_flow: false,
sign_up_mfa_priority_bucket: nil,
}

expect(@analytics).to have_received(:track_event).
Expand Down Expand Up @@ -616,7 +610,6 @@
phone_fingerprint: Pii::Fingerprinter.fingerprint(parsed_phone.e164),
enabled_mfa_methods_count: 0,
in_multi_mfa_selection_flow: false,
sign_up_mfa_priority_bucket: nil,
}

expect(@analytics).to have_received(:track_event).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
pii_like_keypaths: [[:mfa_method_counts, :phone]],
error_details: nil,
enabled_mfa_methods_count: 1,
sign_up_mfa_selection_order_bucket: nil,
})
expect(@analytics).to receive(:track_event).
with('Backup Code Created', {
Expand Down
3 changes: 1 addition & 2 deletions spec/controllers/users/phone_setup_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

expect(@analytics).to receive(:track_event).
with('User Registration: phone setup visited',
{ enabled_mfa_methods_count: 0,
sign_up_mfa_selection_order_bucket: nil })
{ enabled_mfa_methods_count: 0 })
expect(NewPhoneForm).to receive(:new).with(
user:,
analytics: kind_of(Analytics),
Expand Down
Loading