Modifier and Type | Field and Description |
---|---|
static JwtClaims |
NONE
Singleton instance representing no claims
|
Modifier and Type | Method and Description |
---|---|
default java.util.List<java.lang.String> |
getAudience()
The recipients that the JWT is intended for.
|
default java.util.Optional<java.time.Instant> |
getExpirationTime()
Expiration time on or after which the JWT MUST NOT be accepted for processing.
|
default java.util.Optional<java.time.Instant> |
getIssuedAt()
The time at which the JWT was issued.
|
default java.util.Optional<java.lang.String> |
getIssuer()
The principal that issued the JWT
|
default java.util.Optional<java.lang.String> |
getJwtId()
Unique identifier for the JWT
|
default java.util.Optional<java.time.Instant> |
getNotBeforeTime()
The time before which the JWT MUST NOT be accepted for processing.
|
default java.util.Optional<java.lang.String> |
getSubject()
The principal that is the
subject of the JWT.
|
default boolean |
isBeforeValidity(java.time.Clock clock,
boolean required,
java.time.Duration skew)
Check if JWT is before its defined validity
|
default boolean |
isExpired(java.time.Clock clock,
boolean required,
java.time.Duration skew)
Check if JWT is expired
|
default boolean |
isValid()
Check JWT validity against current time with 1MIN clock skew.
|
getArrayStringClaim, getDoubleClaim, getIntClaim, getLongClaim, getNested, getNumericDateClaim, getStringClaim
static final JwtClaims NONE
default java.util.Optional<java.lang.String> getIssuer()
iss
claimdefault java.util.Optional<java.lang.String> getSubject()
sub
claimdefault java.util.List<java.lang.String> getAudience()
aud
claimdefault java.util.Optional<java.time.Instant> getExpirationTime()
exp
claimdefault boolean isExpired(java.time.Clock clock, boolean required, java.time.Duration skew)
clock
- Clock representing reference time of checkingrequired
- indication whether the claim is required, i. e. whether token with claim is considered expiredskew
- allowed clock skew to account for drift between provider and usexp
claim is not present and required
is true
default java.util.Optional<java.time.Instant> getNotBeforeTime()
default boolean isBeforeValidity(java.time.Clock clock, boolean required, java.time.Duration skew)
clock
- Clock representing reference time of checkingrequired
- indication, whether the claim is required, i. e. whether token without nbf is considered before validityskew
- allowed clock skew to account for drift between provider and usdefault boolean isValid()
default java.util.Optional<java.time.Instant> getIssuedAt()
exp
claimdefault java.util.Optional<java.lang.String> getJwtId()
jti
claim