[Bug] MSAL.NET throws a MsalClientException and not a MsalServiceException for the reset password exception from AAD B2C
See original GitHub issueWhich 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:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes agree. even if this is a behavioral breaking change.
@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.