From fd4199e2bbc93aa171f716df388bc0db4ae8835c Mon Sep 17 00:00:00 2001 From: 50c <13584628+50c@users.noreply.github.com> Date: Wed, 14 Feb 2024 12:49:24 +0100 Subject: [PATCH] fix: JsonWebKey deserialization --- src/NetDevPack.Security.Jwt.Core/Model/Key.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NetDevPack.Security.Jwt.Core/Model/Key.cs b/src/NetDevPack.Security.Jwt.Core/Model/Key.cs index b6934a3..a6dc0c7 100644 --- a/src/NetDevPack.Security.Jwt.Core/Model/Key.cs +++ b/src/NetDevPack.Security.Jwt.Core/Model/Key.cs @@ -28,7 +28,10 @@ public KeyMaterial(CryptographicKey cryptographicKey) public JsonWebKey GetSecurityKey() { - return JsonSerializer.Deserialize(Parameters); + //problem here are default Serializer options. If these options don't have the property PropertyNameCaseInsensitive = true, the deserialization will fail. + //var jsonWebKey = JsonSerializer.Deserialize(Parameters); + var jsonWebKey = JsonWebKey.Create(Parameters); + return jsonWebKey; } public void Revoke(string reason=default)