Open Closed

Question on password requirements #6286


User avatar
0
balessi75 created

ABP Commercial 7.4.2 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme

Hi,

How can I get the password complexity requirements setup in ABP Settings for use in JS on the front-end Registration page?

Is there a Service that can be injected for use in the Registration page?

I tried the following, but it returns the default password settings from MS instead of the values set in the ABP Settings page.

private readonly IdentityOptions _identityOptions;

public nVisionRegisterModel(IOptions<IdentityOptions> identityOptions) : base ()
{
    _identityOptions = identityOptions.Value;

}

Thanks in advance!

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    balessi75 created

    For anyone running into the same issue, you just need to inject ABP's ISettingProvider

    See ABP's documentation

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    ABP will override the default value using the setting value

    https://github.com/abpframework/abp/blob/260507ff4ed476d42efbd2012c545adf99bb0c28/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityOptionsManager.cs

    You need to call the SetAsync first: https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

    protected IOptions<IdentityOptions> IdentityOptions { get; }
    
    ....
    
    await IdentityOptions.SetAsync();
    
    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 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.