Skip to content

Commit 9e269c3

Browse files
committed
Only add kid if the value is not null/empty
1 parent 3dec144 commit 9e269c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/oidc/msg/AbstractMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public String toJwt(Key signingKey, String alg, Key transportKey, String encAlg,
451451
header = new HashMap<String, Object>();
452452
header.put("alg", alg);
453453
header.put("typ", "JWT");
454-
if (signingKey != null && signingKey.getKid() != null) {
454+
if (signingKey != null && !Strings.isNullOrEmpty(signingKey.getKid())) {
455455
header.put("kid", signingKey.getKid());
456456
}
457457
Algorithm algorithm = null;
@@ -696,4 +696,4 @@ public String toString() {
696696
return super.toString();
697697
}
698698

699-
}
699+
}

0 commit comments

Comments
 (0)