diff --git a/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs b/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs index 05cede50f..ba9c8a00a 100644 --- a/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs +++ b/src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs @@ -408,9 +408,13 @@ JsonWebTokenTypes.Jwt or JsonWebTokenTypes.Prefixes.Application + JsonWebTokenTy }); // Restore the claim destinations from the special oi_cl_dstn claim (represented as a dictionary/JSON object). - if (token.TryGetPayloadValue(Claims.Private.ClaimDestinationsMap, out ImmutableDictionary destinations)) + // + // Note: starting in 7.0, Wilson no longer uses JSON.NET and supports a limited set of types for the + // TryGetPayloadValue() API. Since ImmutableDictionary is not supported, the value + // is retrieved as a Dictionary, which is supported by both Wilson 6.x and 7.x. + if (token.TryGetPayloadValue(Claims.Private.ClaimDestinationsMap, out Dictionary destinations)) { - context.Principal.SetDestinations(destinations); + context.Principal.SetDestinations(destinations.ToImmutableDictionary()); } context.Logger.LogTrace(SR.GetResourceString(SR.ID6001), context.Token, context.Principal.Claims);