How to generate forgotPassword link dynamically

Javier Monleon Lopez 21 Reputation points

I have a signin-signup user flow within an AAD B2C in where users are added manually into the AAD directory by the owner through an invitation.

First time those users want to login the B2C directory, under the hood, they are forced to set their own password through the forgotPassword link. In there, they are prompted to introduce their email for receiving a code, which will be used to set the new password.

Currently, that link is provided by the "Forgot your password?" link of the Azure's login template.

Since the users are added manually to the AAD by the owner through an invitation, what I need is to generate the forgotPassword link through an api request or similar in order to let the owner sending it via a third party email along with the invitation, instead doing it through the template.

I tried to copy the url but when I open it in another browser I receive "bad request".

Any suggestion?

Thanks in advance.

Azure Active Directory External Identities
No comments
{count} votes

Accepted answer
  1. Shweta Mathur 11,166 Reputation points Microsoft Employee

    Hi @Javier Monleon Lopez ,

    Thanks for reaching out.

    I understand you are manually creating the users in B2C and looking to send the forgot Password link separately via email along with the invitation.

    The link you are trying to copy is in continuation of Sign In policy where clicking on "Forgot password" redirects the user automatically to password reset page.

    To send the password link separately, you can create the new user flow "Password Reset" to reset the password.


    and send the below URL along with invitation to update the password directly


    where B2C_1_pwdReset is password reset user flow policy.

    Users can directly reset the password with link provided in the email.


    Hope this will help.



    Please remember to "Accept Answer" if answer helped you.

    No comments

1 additional answer

Sort by: Most helpful
  1. Javier Monleon Lopez 21 Reputation points

    It is exacly what I was lookin for.

    Thank you so much for your answer!

    No comments