Starts in:
3 DAYS
1 HR
48 MIN
28 SEC
Starts in:
3 D
1 H
48 M
28 S
Open Closed

Create user without password #4915


User avatar
0
mmarjeh created

Hi All,

I had an old asp.net MVC application and now try to move it to ABP Framework, in our application we create a user account without password once admin add new employee, then send reset password link via email to recent created account.

Could you please advise how to implement the same scenario using ABP Framework?

  • ABP Framework version: v7.0.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Yes, you can. but I don't know what's blocking you, can you explain it in detail? thanks.

  • User Avatar
    0
    mmarjeh created

    Hi,

    Yes, you can. but I don't know what's blocking you, can you explain it in detail? thanks.

    Hi,

    How to get reset password URL form the client app? should we use settings file or ABP has predefined feature for that?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Yes, we have an HTTP API you can use to send the reset password code email.

    You can also send it manually:

    
    // inject IdentityUserManager and IAccountEmailer service.
    protected IdentityUserManager UserManager { get; }
    protected IAccountEmailer AccountEmailer { get; }
    
    //Find a user
    var resetToken = await UserManager.GeneratePasswordResetTokenAsync(user);
    await AccountEmailer.SendPasswordResetLinkAsync(user, resetToken, input.AppName, input.ReturnUrl, input.ReturnUrlHash);
    
  • User Avatar
    0
    mmarjeh created

    Hi,

    Yes, we have an HTTP API you can use to send the reset password code email.

    You can also send it manually:

     
    // inject IdentityUserManager and IAccountEmailer service. 
    protected IdentityUserManager UserManager { get; } 
    protected IAccountEmailer AccountEmailer { get; } 
     
    //Find a user 
    var resetToken = await UserManager.GeneratePasswordResetTokenAsync(user); 
    await AccountEmailer.SendPasswordResetLinkAsync(user, resetToken, input.AppName, input.ReturnUrl, input.ReturnUrlHash); 
    

    Thanks for your kind support !

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06