-
Notifications
You must be signed in to change notification settings - Fork 340
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] The JSON value could not be converted to System.Int64. ROPC flow #3892
Comments
Would be nice to have an E2E test with B2C + ROPC, even if we have to hardcode client id etc. |
Based on the question shared by @dmitriyi-affinity, all token responses from B2C suffer from this, not just ROPC. So this affects B2C + desktop apps. |
Can confirm that this also affects "Interactive" flow as well:
This works even with the latest 4.49.1 version, when targeting .NET Framework (4.7.2). Have further investigated that it has to do with the "System.Text.Json" package itself. |
This System.Text.Json behavior was not documeted as a breaking change https://devblogs.microsoft.com/dotnet/system-text-json-in-dotnet-7/#breaking-changes Note that we've only started using System.Text.Json since MSAL 4.47.0 (roughly). If you use 4.46 it should be ok. |
I can confirm with my testing that targeting .NET 7 causes this issue. Targeting .NET 6 seems to resolve it with the latest version of MSAL so targeting 6.0.7 seems to be a temporary work around |
Found a potential solution.
It seems like tergetting .NET 7 causes the However, using |
opened bug on .NET 7 repo |
Hello! |
I'll let @trwalke clarify, but I think we'll fix it separately from .NET folks - there is a PR in progress. We'll probably have a release with the fix in 1-2 weeks. If this blocking you, we can accelerate, but I assume you can use MSAL 4.47.2 for now? |
We have a workaround that resolves this issue for us. The .NET 7 team will continue to resolve the root cause on their side but at least we have a solution for now. |
Logs and network traces
Which version of MSAL.NET are you using?
MSAL.NET 4.49.x, 4.48.x - Problem
Works in 4.47.2 - No Issues
Platform
.Net 7.0, .Net 6.0 (.Net 4.8 not tested)
What authentication flow has the issue?
Other?
Is this a new or existing app?
a. The app is in production, and I have upgraded to a new version of MSAL.
-->
Repro
Some guess about the issue:

Probably something went wrong when STJ deseriailzer Source Generator ignored the settings that are defined here:

Azure AD B2C returns expires_in field as a string :(
https://learn.microsoft.com/en-us/answers/questions/877384/azure-active-directory-b2c-authorization-code-flow.html
The text was updated successfully, but these errors were encountered: