From 83d7ec19bcc3dc9b6772b8269b2325f64e15cff0 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sun, 15 May 2022 11:33:50 +0200 Subject: [PATCH] error kid invalid --- src/main/java/com/covas/Resources/TokenRessource.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/covas/Resources/TokenRessource.java b/src/main/java/com/covas/Resources/TokenRessource.java index 72ddc6f..4c80581 100644 --- a/src/main/java/com/covas/Resources/TokenRessource.java +++ b/src/main/java/com/covas/Resources/TokenRessource.java @@ -72,6 +72,10 @@ public class TokenRessource { return Response.status(Response.Status.NOT_ACCEPTABLE).build(); } // or jwt = parser.decrypt(jwtCookie, secret); + String kid = jwt.getClaim(Claims.kid).toString(); + if(!kid.equals(users.id.toString())){ + return Response.status(Response.Status.UNAUTHORIZED).build(); + } return Response.status(Response.Status.OK).build(); }