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

Replace Newtonsoft.Json with System.Text.Json on all TFMs #5057

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bgavrilMS
Copy link
Member

@bgavrilMS bgavrilMS commented Jan 6, 2025

Fixes #4518 and #5056

Changes proposed in this request

  • remove newtonsoft from MSAL (but not from tests, it's missing some functionality around DeepEquals)

  • use System.Text.Json version 6.0.11 (in line with other SDKs) on .NET FWK and .NET Standard

  • use inbuilt System.Text.Json (i.e. version 8) on the rest of the TFMs (like before on net8)
     
    Testing

  • PCA browser

  • WAM

  • Android Browser

  • Android Broker

Performance impact

  • not needed since the changes do not affect .NET

Documentation

  • no public API changes


namespace Microsoft.Identity.Client.Cache
{
/// <summary>
/// Contains the results of an ADAL token acquisition. Access Tokens from ADAL are not compatible
/// with MSAL, only Refresh Tokens are.
/// </summary>
[JsonObject]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These attributes are no longer needed.

@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Targets required for unit tests to run">
<TargetFrameworkNetDesktop462>net462</TargetFrameworkNetDesktop462>
<TargetFrameworkNetDesktop472>net472</TargetFrameworkNetDesktop472>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be reviewed carefully.

@bgavrilMS bgavrilMS changed the title Bogavril/sjt Replace Newtonsoft.Json with System.Text.Json on all TFMs Jan 6, 2025
@bgavrilMS bgavrilMS requested a review from Copilot January 7, 2025 19:13

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 283 out of 298 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • Directory.Packages.props: Language not supported
  • build/platform_and_feature_flags.props: Language not supported
  • src/client/Microsoft.Identity.Client/Cache/Items/MsalAppMetadataCacheItem.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/AuthScheme/PoP/PopAuthenticationOperation.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/Items/MsalIdTokenCacheItem.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/Items/MsalRefreshTokenCacheItem.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/Items/MsalCredentialCacheItemBase.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/AppConfig/TraceTelemetryConfig.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/TokenCacheDictionarySerializer.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/Items/MsalCacheItemBase.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/ITokenCacheSerializable.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/AppConfig/AbstractApplicationBuilder.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/AppConfig/BaseAbstractApplicationBuilder.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/Items/MsalAccountCacheItem.cs: Evaluated as low risk
  • src/client/Microsoft.Identity.Client/Cache/Items/MsalAccessTokenCacheItem.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

src/client/Microsoft.Identity.Client/Cache/Items/MsalItemWithAdditionalFields.cs:55

  • Ensure that the conversion to string correctly handles null values and the filter logic. Verify that the behavior remains consistent with the previous implementation.
string asString = asObj.GetValue<string>();
@ETEnterprises1
Copy link

-git commit -new push request: 'for' integration of "[email protected]" 'for' integrating 'at' @dependabot.automated-updates 'to' repository
#Then
Git request pull -to: 'BMO-Financial-Group to create new file and folder for integration'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants