Skip to content

Commit cde4b1d

Browse files
Merge branch 'dev' of https://github.com/BastiaanJansen/JWT-Java into dev
2 parents 42ef044 + d326e43 commit cde4b1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Date exp = payload.getExpirationTime();
208208
Date nbf = payload.getNotBefore();
209209
String[] audience = payload.getAudience();
210210

211-
Object customClaim = payload.getClaim("username");
211+
String customClaim = payload.getClaim("username", String.class);
212212

213213
boolean hasClaim = payload.containsClaim("key");
214214
```
@@ -245,7 +245,7 @@ JWTValidator validator = new DefaultJWTValidator.Builder()
245245
.withIssuer("issuer")
246246
.withID("id")
247247
.withOneOfAudience("aud1", "aud2") // Enforce audience has "aud1" or "aud2"
248-
.withCLaim("username", "BastiaanJansen") // Enforce custom claim value
248+
.withClaim("username", "BastiaanJansen") // Enforce custom claim value
249249
.build();
250250

251251
try {

0 commit comments

Comments
 (0)