Package restapi.utils.security.token
Class JWTTokenService
java.lang.Object
restapi.utils.security.token.JWTTokenService
- All Implemented Interfaces:
io.jsonwebtoken.Clock,TokenService
@Service
public final class JWTTokenService
extends Object
implements io.jsonwebtoken.Clock, TokenService
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intprivate static final io.jsonwebtoken.impl.compression.GzipCompressionCodec(package private) DateServiceprivate static final String(package private) int(package private) String(package private) String -
Constructor Summary
ConstructorsConstructorDescriptionJWTTokenService(DateService dates, String issuer, int expirationSec, int clockSkewSec, String secret) -
Method Summary
Modifier and TypeMethodDescriptionprivate Stringnow()parseClaims(com.google.common.base.Supplier<io.jsonwebtoken.Claims> toClaims) Checks the validity of the given credentials.Checks the validity of the given credentials.
-
Field Details
-
DOT
- See Also:
-
COMPRESSION_CODEC
private static final io.jsonwebtoken.impl.compression.GzipCompressionCodec COMPRESSION_CODEC -
dates
DateService dates -
issuer
String issuer -
expirationSec
int expirationSec -
clockSkewSec
int clockSkewSec -
secretKey
String secretKey
-
-
Constructor Details
-
JWTTokenService
JWTTokenService(DateService dates, @Value("${jwt.issuer:neerby}") String issuer, @Value("${jwt.expiration-sec:86400}") int expirationSec, @Value("${jwt.clock-skew-sec:300}") int clockSkewSec, @Value("${jwt.secret:secret}") String secret)
-
-
Method Details
-
permanent
- Specified by:
permanentin interfaceTokenService
-
expiring
- Specified by:
expiringin interfaceTokenService
-
newToken
-
verify
Description copied from interface:TokenServiceChecks the validity of the given credentials.- Specified by:
verifyin interfaceTokenService- Returns:
- attributes if verified
-
untrusted
Description copied from interface:TokenServiceChecks the validity of the given credentials.- Specified by:
untrustedin interfaceTokenService- Returns:
- attributes if verified
-
parseClaims
-
now
- Specified by:
nowin interfaceio.jsonwebtoken.Clock
-