Skip to content

Commit 7af15c2

Browse files
committed
add kid
1 parent bff0950 commit 7af15c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

BankApi.Core/Defaults/Helper.JwsResponseSigningMiddleware.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class JwsResponseSigningMiddleware
88
{
99
private readonly RequestDelegate _next;
1010
private readonly ECDsa _ecSigner;
11-
private static readonly string[] headerCritValue = ["iat", "alg"];
11+
private static readonly string[] headerCritValue = ["kid", "alg"];
1212
private static readonly string[] pathsToSkip = ["/scalar", "/openapi", "/health"];
1313

1414
public JwsResponseSigningMiddleware(RequestDelegate next, ECDsa ecSigner)
@@ -37,8 +37,9 @@ public async Task InvokeAsync(HttpContext context)
3737

3838
var extraHeaders = new Dictionary<string, object>
3939
{
40+
{ "crit", headerCritValue },
4041
{ "iat", DateTimeOffset.UtcNow.ToUnixTimeSeconds() },
41-
{ "crit", headerCritValue }
42+
{ "kid", "bank-api-2025-1" }
4243
};
4344

4445
// Sign the response body using ECDSA

0 commit comments

Comments
 (0)