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) int
private static final io.jsonwebtoken.impl.compression.GzipCompressionCodec
(package private) DateService
private 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 String
now()
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:
permanent
in interfaceTokenService
-
expiring
- Specified by:
expiring
in interfaceTokenService
-
newToken
-
verify
Description copied from interface:TokenService
Checks the validity of the given credentials.- Specified by:
verify
in interfaceTokenService
- Returns:
- attributes if verified
-
untrusted
Description copied from interface:TokenService
Checks the validity of the given credentials.- Specified by:
untrusted
in interfaceTokenService
- Returns:
- attributes if verified
-
parseClaims
-
now
- Specified by:
now
in interfaceio.jsonwebtoken.Clock
-