Newtonsoft.Json types replaced in Microsoft.AspNetCore.Authentication APIs #341
Labels
3.0.0
Announcements related to ASP.NET Core 3.0
Announcement
Breaking change
Documented
The breaking change has been published to the .NET Core docs
Migrated
Milestone
Uh oh!
There was an error while loading. Please reload this page.
As part of the ongoing effort to remove Newtonsoft.Json from the shared framework these types have now been replaced on the Authentication APIs.
Basic usage of these Authentication packages should be unaffected. Only users who have derived from the OAuth package or that had implemented advanced claim manipulation should be affected. A detailed list of affected APIs is given below.
Affected packages:
Also, all derived implementations of OAuth such as those from aspnet-contrib.
For derived OAuth implementations the most common change is to replace JObject.Parse with JsonDocument.Parse in the CreateTicketAsync override as shown here. Note JsonDocument is IDisposable.
Affected APIs:
ClaimAction.Run(JObject userData, ClaimsIdentity identity, string issuer)
becomesClaimAction.Run(JsonElement userData, ClaimsIdentity identity, string issuer)
. All derived implementations of ClaimAction are similarly affected.MapCustomJson(this ClaimActionCollection collection, string claimType, Func<JObject, string> resolver)
becomesMapCustomJson(this ClaimActionCollection collection, string claimType, Func<JsonElement, string> resolver)
MapCustomJson(this ClaimActionCollection collection, string claimType, string valueType, Func<JObject, string> resolver)
becomesMapCustomJson(this ClaimActionCollection collection, string claimType, string valueType, Func<JsonElement, string> resolver)
See dotnet/aspnetcore#7289 for discussion. See dotnet/aspnetcore#7105 for details of the change.
This announcement has been migrated to: dotnet/docs#14836
The text was updated successfully, but these errors were encountered: