Skip to content

Commit fd4199e

Browse files
committed
fix: JsonWebKey deserialization
1 parent d7ea6d7 commit fd4199e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/NetDevPack.Security.Jwt.Core/Model

src/NetDevPack.Security.Jwt.Core/Model/Key.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ public KeyMaterial(CryptographicKey cryptographicKey)
2828

2929
public JsonWebKey GetSecurityKey()
3030
{
31-
return JsonSerializer.Deserialize<JsonWebKey>(Parameters);
31+
//problem here are default Serializer options. If these options don't have the property PropertyNameCaseInsensitive = true, the deserialization will fail.
32+
//var jsonWebKey = JsonSerializer.Deserialize<JsonWebKey>(Parameters);
33+
var jsonWebKey = JsonWebKey.Create(Parameters);
34+
return jsonWebKey;
3235
}
3336

3437
public void Revoke(string reason=default)

0 commit comments

Comments
 (0)