AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.64k stars 2.65k forks source link

Angular msal 2.0 forgot password did not work #2906

Closed jitendraP-ashutec closed 3 years ago

jitendraP-ashutec commented 3 years ago

Library

Description

I have tried angular 11 b2c project which you provided. I have used same credentials which you provided in sample but forgot password is not working. it redirecting to login page itself.

I have also tried with my credentials but it redirecting to change password instead of redirecting to forgot password.

Source

 let resetPasswordFlowRequest = {
            scopes: ["openid","profile"], // I have tried with openid
    authority: environment.b2cPasswordReset,
  }
  this.msal.loginRedirect(resetPasswordFlowRequest);

same b2cPasswordReset url is working in msal 1.0 but not working in msal2.0

@jo-arroyo could you please let me know if I am doing something wrong.

jo-arroyo commented 3 years ago

@jitendraP-ashutec Can you please share what the value of environment.b2cPasswordReset is?

jitendraP-ashutec commented 3 years ago

@jo-arroyo Thanks For response. It was my mistake. I am passing wrong passwordReset URL.

    this.broadcastService.msalSubject$.subscribe((result: EventMessage) => {
        if (result.error instanceof AuthError){}   
     });

In Sample code you checked instanceOf AuthError but it is not working.

github-actions[bot] commented 3 years ago

This issue has not seen activity in 14 days. It will be closed in 7 days if it remains stale.

github-actions[bot] commented 3 years ago

This issue has been closed due to inactivity. If this has not been resolved please open a new issue. Thanks!

jitendraP-ashutec commented 3 years ago

I was using wrong wrong url in password resetting so that its was not working.

Thanks @jo-arroyo