Class JwtTimestampValidator
java.lang.Object
com.codename1.backend.security.oauth2.jwt.JwtTimestampValidator
- All Implemented Interfaces:
OAuth2TokenValidator<Jwt>
Refuses a token past its exp or ahead of its nbf, with a minute's
allowance either way for two machines whose clocks disagree.
A token with neither claim passes: whether a token must expire is for the issuer to decide and for another validator to demand.
-
Constructor Summary
ConstructorsConstructorDescriptionWith the allowance of 60 seconds.JwtTimestampValidator(long clockSkewSeconds) -
Method Summary
Modifier and TypeMethodDescriptionvoidReads the time fromclockinstead of the machine.Whethertokenpasses, and why not.
-
Constructor Details
-
JwtTimestampValidator
public JwtTimestampValidator()With the allowance of 60 seconds. -
JwtTimestampValidator
public JwtTimestampValidator(long clockSkewSeconds) - Parameters:
clockSkewSeconds- how far pastexpor ahead ofnbfstill passes
-
-
Method Details
-
setClock
Reads the time fromclockinstead of the machine. -
validate
Description copied from interface:OAuth2TokenValidatorWhethertokenpasses, and why not.- Specified by:
validatein interfaceOAuth2TokenValidator<Jwt>
-