public class JwtValidator extends Object
Constructor and Description |
---|
JwtValidator()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
validateClaim(JwtClaimsSet claimsSet,
JsonPointer claimPointer,
Predicate<JsonValue> predicate)
Validate that a claim in the claim set is present and has a value that passes the supplied predicate.
|
boolean |
validateClaim(JwtClaimsSet claimsSet,
JsonPointer claimPointer,
Predicate<JsonValue> predicate,
String failureMessage)
Validate that a claim in the claim set is present and has a value that passes the supplied predicate.
|
boolean |
validateClaimPresent(JwtClaimsSet claimsSet,
JsonPointer claimPointer)
Validate that a claim in the claim set is present and has a value.
|
boolean |
validateExpiry(Jwt jwt)
Conduct validation to confirm expiry date has not passed (accommodating skew).
|
boolean |
validateJwtBasic(Jwt jwt,
String clientId)
Conduct basic JWT validation.
|
public JwtValidator()
Clock.systemUTC()
.public boolean validateJwtBasic(Jwt jwt, String clientId)
clientId
jwt
- The JWT to validate.clientId
- The client id to use in validation.public boolean validateExpiry(Jwt jwt)
jwt
- The JWT to validate.public boolean validateClaimPresent(JwtClaimsSet claimsSet, JsonPointer claimPointer)
claimsSet
- The JWT's claim set to check.claimPointer
- The JsonPointer
of the claim to check the presence of.public boolean validateClaim(JwtClaimsSet claimsSet, JsonPointer claimPointer, Predicate<JsonValue> predicate)
claimsSet
- The JWT's claim set to check.claimPointer
- The JsonPointer
of the claim to validate.predicate
- Predicate to test the claim's validity.predicate
.public boolean validateClaim(JwtClaimsSet claimsSet, JsonPointer claimPointer, Predicate<JsonValue> predicate, String failureMessage)
claimsSet
- The JWT's claim set to check.claimPointer
- The JsonPointer
of the claim to validate.predicate
- Predicate to test the claim's validity.failureMessage
- Message to log on validation failure. If null, a generic warning is logged.predicate
.Copyright 2011-2017 ForgeRock AS.