Open Closed

Making TOTP 2FA provider independent from other two and modifying 2FA force behavior #9845


User avatar
0
shamyratpashiyev created

Greetings, there are some problems I encountered in layered ABP solution:

  1. I need to disable email and phone number providers in 2FA and leave only TOTP provider functional, ie. I need to make it so that users can enable TOTP provider without verifying phone number or email. How can I achieve that? Please provide detailed instructions.
  2. And I need to make it so force behavior in 2FA works with TOTP, i.e when 2FA behavior is set to force, I need the app to redirect the user to Two Factor Authentication page at "/Account/Manage" and so the user is not able to log in without enabling TOTP app. Please give me detailed instructions on this as well.

29 Answer(s)
  • User Avatar
    0
    shamyratpashiyev created

    Hi, can you please help me with disabling error message "You have to enable at least one two factor provider to enable two factor!" which appears when user enables 2FA in /Accounts/Manage page without verifying email or phone, here is the screenshot:

  • User Avatar
    0
    shamyratpashiyev created

    And there is another problem, when I override and enable 2FA tab in /Accounts/Manage Page manually with: " Configure<ProfileManagementPageOptions>(options => { options.Contributors.RemoveAll(x => x.GetType() == typeof(AccountProfileManagementPageContributor)); options.Contributors.Add(new MyAccountProfileManagementPageContributor()); }); ", the tab is duplicated, i.e there are two 2FA tabs, here is the screenshot:

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Hi, can you please help me with disabling error message "You have to enable at least one two factor provider to enable two factor!" which appears when user enables 2FA in /Accounts/Manage page without verifying email or phone, here is the screenshot:

    You can add a valid authenticator, then enable 2FA.

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Add this line in the MyAccountProfileManagementPageContributor

    context.Groups.RemoveAll(x => x.Id == "Volo-Abp-Account-TwoFactor");

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 10, 2025, 06:30