Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Exception during RemoveAsync - Invalid JSON String #3248

Closed
1 of 4 tasks
riyabans opened this issue Mar 24, 2022 · 9 comments · Fixed by #3253
Closed
1 of 4 tasks

[Bug] Exception during RemoveAsync - Invalid JSON String #3248

riyabans opened this issue Mar 24, 2022 · 9 comments · Fixed by #3253

Comments

@riyabans
Copy link

Logs and network traces
https://microsoftapc-my.sharepoint.com/:x:/g/personal/riyabansal_microsoft_com/EaWZbnfBc4xNpq_VwrAkeIsBXId-gq4s5QvJY4L7Lwg_QQ?e=4TgX9I

Which version of MSAL.NET are you using?
MSAL.NET 4.42.0.0

Platform
.NET 4.7, WPF

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Authentication
    • Username Password
    • Device code flow (browserless)

Other?
We are getting this exception when we try to remove the user account using the MSAL function:PublicClientApp.RemoveAsync(Account).

We have added a null check for the account.

"ErrorMessage": "Invalid JSON string. (Exception from HRESULT: 0x83750007)",
"ErrorLocation": " at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Identity.Client.Platforms.Features.WamBroker.WamBroker.d__32.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Identity.Client.ClientApplicationBase.d__24.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Identity.Client.ClientApplicationBase.d__23.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at MicrosoftWhiteboard.Auth.MsalClient.d__11.MoveNext()"

Is this a new or existing app?

The app is in production, I haven't upgraded MSAL, but started seeing this issue.

Repro
Not able to repro at our end. One of the customers reported it to us.

Expected behavior
No Exception should occur. Customer should be able to logout

Actual behavior
Customer is not able to logout due to this exception.

@bgavrilMS
Copy link
Member

I think this happens because RemoveAccount has a bug where it does not correctly infer if the account belongs to AAD or to MSA.

@pmaytak pmaytak added this to Triage in MSAL.NET (legacy) via automation Mar 30, 2022
@pmaytak pmaytak added this to the 4.43.0 milestone Mar 30, 2022
@pmaytak pmaytak moved this from Triage to In Progress in MSAL.NET (legacy) Mar 30, 2022
MSAL.NET (legacy) automation moved this from In Progress to Fixed Mar 31, 2022
bgavrilMS added a commit that referenced this issue Mar 31, 2022
* Fix for #3248 - use the correct plugin to sing out

* fix

* Comments
@riyabans
Copy link
Author

riyabans commented Apr 4, 2022

Thanks @bgavrilMS for closing this issue. Can you share some visibility on when would be able to update our MSAL libraries to 4.43.0 version?

Thanks,
Riya Bansal

@bgavrilMS
Copy link
Member

Hi @riyabans - we aim to ship MSAL 4.43 this week, should be out there by Wednesday (but hopefully by end of day Monday)

Csaba8472 added a commit to Csaba8472/microsoft-authentication-library-for-dotnet that referenced this issue Apr 24, 2022
…library-for-dotnet

* 'master' of github.com:AzureAD/microsoft-authentication-library-for-dotnet: (39 commits)
  OBO for SP with RT support (AzureAD#3266) (AzureAD#3280)
  Update some projects to net48 (AzureAD#3269)
  Bump Source Link version (tool change) (AzureAD#3275)
  Update changelog.txt (AzureAD#3282)
  Default to WebView1 instead of WebView2 when using AAD or ADFS authorities (AzureAD#3276)
  Revert "OBO for SP with RT support (AzureAD#3266)"
  OBO for SP with RT support (AzureAD#3266)
  Add perf tests for Acquire Token calls with serialization cache and Builders (AzureAD#3250)
  Minor fix to SuggestedCacheKey comment and update NuGet icon in Readme. (AzureAD#3268)
  MSAL changelog 4.43.0 (AzureAD#3263)
  Bogavril/3251 (AzureAD#3255)
  Fix for AzureAD#3248 - use the correct plugin to sing out (AzureAD#3253)
  Performance project improvements (AzureAD#3064)
  Reuse lists in token cache filtering logic. (AzureAD#3233)
  Update andorid install script to use andorid 30 (AzureAD#3243)
  Fix for UWP packaging (AzureAD#3239)
  Pass account to Auth result (AzureAD#3199)
  App ported to Lab4 (AzureAD#3229)
  Trwalke/ruleset updates (AzureAD#3189)
  Conditional Access for Android (AzureAD#3210)
  ...
@NakulSabharwal
Copy link

@bgavrilMS After updating to v43, we are still seeing this issue.

@bgavrilMS
Copy link
Member

Hi @NakulSabharwal - we aim to release another implementation of the WAM broker, which will fix this issue and the "run as admin" issue as well. It will come with MSAL 4.44, scheduled early next week.

@bgavrilMS bgavrilMS reopened this May 10, 2022
@bgavrilMS bgavrilMS moved this from Fixed to In Progress in MSAL.NET (legacy) May 10, 2022
@bgavrilMS bgavrilMS modified the milestones: 4.43.0, 4.44.0 May 10, 2022
@NakulSabharwal
Copy link

@bgavrilMS Is there any workaround for this bug to logout successfully that we can use until this issue is fixed ?

@bgavrilMS bgavrilMS moved this from In Progress to Triage in MSAL.NET (legacy) May 13, 2022
@bgavrilMS
Copy link
Member

Should work now with MSAL 4.44 with new broker implementation - see https://aka.ms/msal-net-wam

@pmaytak pmaytak removed this from the 4.44.0 milestone May 24, 2022
@bgavrilMS bgavrilMS moved this from Triage to Estimated/Committed in MSAL.NET (legacy) May 26, 2022
@bgavrilMS bgavrilMS moved this from Estimated/Committed to Blocked/Waiting for reply in MSAL.NET (legacy) May 31, 2022
@bgavrilMS
Copy link
Member

bgavrilMS commented May 31, 2022

It looks like the error is coming from WAM and Nakul will follow up with WAM via ICM.
The error is not critical, i.e. the user is removed from MSAL's cache.

@bgavrilMS
Copy link
Member

Can't repro. Suggestion is to try with new WAM implementation - https://aka.ms/msal-net-wam

@bgavrilMS bgavrilMS closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
MSAL.NET (legacy)
  
Blocked/Waiting for reply
4 participants