question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] MSAL.NET throws a MsalClientException and not a MsalServiceException for the reset password exception from AAD B2C

See original GitHub issue

Which Version of MSAL are you using ? First noticed in 4.1, but not sure which version introduced the change in behavior

Platform mobile, desktop, web app

Repro

example, include this code:

catch (MsalServiceException ex)
          {
                try
                {
                          if (ex.Message.Contains("AADB2C90118"))
                          {
                                   authResult = await (app as 
                                         publicClientApplication).AcquireTokenInteractive(App.ApiScopes)
                                        .WithParentActivityOrWindow(new WindowInteropHelper(this).Handle)
                                        .WithAccount(GetAccountByPolicy(accounts, App.PolicySignUpSignIn))
                                        .WithPrompt(Prompt.SelectAccount)
                                        .WithB2CAuthority(App.AuthorityResetPassword)
                                        .ExecuteAsync();
}

Can be tried w/B2C desktop sample.

Expected behavior MSAL.NET should throw a MsalServiceException with the following error message: AADB2C90118: The user has forgotten their password.

Actual behavior MSAL.NET throws a MsalClientException instead

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmprieurcommented, Jul 30, 2019

yes agree. even if this is a behavioral breaking change.

1reaction
henrik-mecommented, Jul 30, 2019

@jennyf19 @jmprieur : I suppose we should consider fixing this as it’s a regression betwen 3 and 4. 4.3 seems like a good vehicle for this change imo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle errors and exceptions in MSAL.NET
MsalServiceException is thrown when the Identity Provider (Azure AD) returns an error. It's a translation of the server error.
Read more >
MSAL Azure ADb2c Throwing error after resetting ...
You are using seperate password reset and sign in/sign up flows. This means once the user performs password reset, the tokens are issued...
Read more >
Implement a 'Password Reset' with JavaScript and Azure ...
Step 1: Configure the appropriate user flow in the B2C portal · Step 2: Extend the SignIn method in your code to capture...
Read more >
MSAL.PS
Identity.Client.AccountId.TenantId"/> separated by a dot. Contrary to what was happening in ADAL.NET, these two segments are no longer base64 encoded. Note that ...
Read more >
The connection test of the OAuth 2.0 integration fails with ...
If you find the following error the Jira application logs, then the Root cause 1 ... Usage of the \/common endpoint is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found