File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
lib/src/test/java/com/auth0/jwt Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,17 @@ public void shouldValidateCustomClaimOfTypeDate() {
526
526
assertThat (jwt , is (notNullValue ()));
527
527
}
528
528
529
+ @ Test
530
+ public void shouldRemoveCustomClaimOfTypeDateWhenNull () {
531
+ JWTVerifier verifier = JWTVerifier .init (Algorithm .HMAC256 ("secret" ))
532
+ .withClaim ("name" , new Date ())
533
+ .withClaim ("name" , (Date ) null )
534
+ .build ();
535
+
536
+ assertThat (verifier .claims , is (notNullValue ()));
537
+ assertThat (verifier .claims , not (hasKey ("iss" )));
538
+ }
539
+
529
540
@ Test
530
541
public void shouldValidateCustomArrayClaimOfTypeString () {
531
542
String token = "eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjpbInRleHQiLCIxMjMiLCJ0cnVlIl19.lxM8EcmK1uSZRAPd0HUhXGZJdauRmZmLjoeqz4J9yAA" ;
You can’t perform that action at this time.
0 commit comments