Open Closed

How to disable some features of the Account Module??? #3033


User avatar
0
diennttlu@gmail.com created

I'm using the Commercial version. I want to disable some features: Account Linking, Two Factor Authentication, User Profile Picture. Help me!!

  • ABP Framework version: v4.4.1
  • UI type: MVC
  • DB provider: EF Core
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Account Linking and User Profile Picture

    public class MyMenuContributor : IMenuContributor
    {
        public async Task ConfigureMenuAsync(MenuConfigurationContext context)
        {
            if (context.Menu.Name == StandardMenus.Main)
            {
                context.Menu.TryRemoveMenuItem("Account.LinkedAccounts");
                context.Menu.TryRemoveMenuItem("Account.Manage");
            }
        }
    }
    

    Two Factor Authentication

    public class MyFeatureDefinitionProvider : FeatureDefinitionProvider
    {
        public override void Define(IFeatureDefinitionContext context)
        {
            var group = context.GetGroupOrNull(IdentityProFeature.GroupName);
    
            var twoFeature = group.Features.First(x => x.Name == IdentityProFeature.TwoFactor);
            twoFeature.DefaultValue = "false";
            twoFeature.IsAvailableToHost = false;
            twoFeature.IsVisibleToClients = false;
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.