Open Closed

Password Settings does not works well #3345


User avatar
0
yasin.hallak.89@gmail.com created
  • ABP Framework version: v5.0.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

hello there ..

I choosed only "Require Digit"

when I add user and set password only digit from new uesr as like figure below :

it works well ..

but when I add user and set password only digit from here :

it not work and give me three errors :

  1. non-alphanumeric character
  2. Required lower case character
  3. Required upper case character

can I have solution for this problem

thank ...

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

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

    Hi,

    I will check it.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    yasin.hallak.89@gmail.com created

    Hi,

    I will check it.

    Ok .. I am waiting you

    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,

    We had this problem on 5.3.0, it was fixed in 5.3.1, can you upgrade to 5.3.1 and try again?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    yasin.hallak.89@gmail.com created

    Hi,

    We had this problem on 5.3.0, it was fixed in 5.3.1, can you upgrade to 5.3.1 and try again?

    Sorry Now I use V5.0.0 Not V5.3.0 ... Can you give me principled solution for now because I use Multi Module for bussinses .and I must to upgrade all of them

    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

    Sorry, my bad, I thought you were using version 5.3.0, let me check it.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    yasin.hallak.89@gmail.com created

    Sorry, my bad, I thought you were using version 5.3.0, let me check it.

    I am sorry my bad ..not your bad ... I was writing V 5.3.0

    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

    I could not reproduce the problem

    Can you provide steps that I can reproduce the problem? thanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    yasin.hallak.89@gmail.com created

    I could not reproduce the problem

    Can you provide steps that I can reproduce the problem? thanks.

    I wrote above steps for my problem .. I need to create user from code and set passwrod only digit as figure above

    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,

    I wrote above steps for my problem ..

    https://support.abp.io/QA/Questions/3345#answer-163eaa79-9777-cdc7-722c-3a04c5a23f8d

    Or, can you use the suite to create a new project to reproduce the problem and share it with me? shiwei.liang@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    yasin.hallak.89@gmail.com created

    I will repeat reproduce my problem

    I want to create user and take Id and use it in my entity Employee as below :

    public virtual async Task<EmployeeDto> CreateAsync(EmployeeCreateDto input)
    {
       
        var email = input.Email ?? $"{input.IdentityNo}@gmail.com";
    
        var user = new IdentityUser(Guid.NewGuid(), input.IdentityNo, email, CurrentTenant.Id);
        user.Surname = input.Name;
        var result = await _userManager.CreateAsync(user, "123456");
        if (!result.Succeeded)
        {
            throw new UserFriendlyException(@L["Validation:ErrorInServer"]);
        }
    
        var employee = ObjectMapper.Map<EmployeeCreateDto, Employee>(input);
        employee.TenantId = CurrentTenant.Id;
        employee.AppUserId = user.Id;
        employee.BirthDate = input.BirthDate.ToDate().Value;
        employee.IdentityDate=input.IdentityDate.ToDate().Value;    
        employee = await _employeeRepository.InsertAsync(employee, autoSave: true);
        return ObjectMapper.Map<Employee, EmployeeDto>(employee);
    }
    

    I set password digit only and set in password setting "Required Digit Only " as below :

    it does not work and give me error as below :

    I hope to be reproduce my problem well .. thanks

    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,

    Can you try this:

    protected IOptions<IdentityOptions> IdentityOptions { get; }
    
    public xxx(IOptions<IdentityOptions> identityOptions)
    {
       IdentityOptions = identityOptions;
    }
    
    public virtual async Task CreateAsync(EmployeeCreateDto input)
    {
        await IdentityOptions.SetAsync(); // this line
       
        var email = input.Email ?? $"{input.IdentityNo}@gmail.com";
    
        var user = new IdentityUser(Guid.NewGuid(), input.IdentityNo, email, CurrentTenant.Id);
        user.Surname = input.Name;
        var result = await _userManager.CreateAsync(user, "123456");
        if (!result.Succeeded)
        {
            throw new UserFriendlyException(@L["Validation:ErrorInServer"]);
        }
    
        var employee = ObjectMapper.Map(input);
        employee.TenantId = CurrentTenant.Id;
        employee.AppUserId = user.Id;
        employee.BirthDate = input.BirthDate.ToDate().Value;
        employee.IdentityDate=input.IdentityDate.ToDate().Value;    
        employee = await _employeeRepository.InsertAsync(employee, autoSave: true);
        return ObjectMapper.Map(employee);
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    yasin.hallak.89@gmail.com created

    Hi,

    Can you try this:

    protected IOptions<IdentityOptions> IdentityOptions { get; } 
     
    public xxx(IOptions<IdentityOptions> identityOptions) 
    { 
       IdentityOptions = identityOptions; 
    } 
     
    public virtual async Task CreateAsync(EmployeeCreateDto input) 
    { 
        await IdentityOptions.SetAsync(); // this line 
        
        var email = input.Email ?? $"{input.IdentityNo}@gmail.com"; 
     
        var user = new IdentityUser(Guid.NewGuid(), input.IdentityNo, email, CurrentTenant.Id); 
        user.Surname = input.Name; 
        var result = await _userManager.CreateAsync(user, "123456"); 
        if (!result.Succeeded) 
        { 
            throw new UserFriendlyException(@L["Validation:ErrorInServer"]); 
        } 
     
        var employee = ObjectMapper.Map(input); 
        employee.TenantId = CurrentTenant.Id; 
        employee.AppUserId = user.Id; 
        employee.BirthDate = input.BirthDate.ToDate().Value; 
        employee.IdentityDate=input.IdentityDate.ToDate().Value;     
        employee = await _employeeRepository.InsertAsync(employee, autoSave: true); 
        return ObjectMapper.Map(employee); 
    } 
    

    thank a lot it works well ...

    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.