public class JwtService
Interface to parse and generate JWTs
| Constructor and Description |
|---|
JwtService(com.ufoscout.coreutils.jwt.JwtService jwtService)
Interface to parse and generate JWTs
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
generate(java.lang.Object payload)
Generates a JWT from the payload
|
java.lang.String |
generate(java.lang.String subject,
java.lang.Object payload)
Generates a JWT from the payload
|
java.lang.String |
generate(java.lang.String subject,
java.lang.Object payload,
java.util.Date createdDate,
java.util.Date expirationDate)
Generates a JWT from the payload
|
com.ufoscout.coreutils.jwt.JwtService |
getJwtService() |
<T> T |
parse(java.lang.String jwt,
kotlin.reflect.KClass<T> payloadClass)
Parses a JWT and return the contained bean.
It throws TokenExpiredException if the token has expired.
|
public JwtService(com.ufoscout.coreutils.jwt.JwtService jwtService)
Interface to parse and generate JWTs
public java.lang.String generate(java.lang.Object payload)
Generates a JWT from the payload
payload - the JWT payloadpublic java.lang.String generate(java.lang.String subject,
java.lang.Object payload)
Generates a JWT from the payload
subject - the JWT subjectpayload - the JWT payloadpublic java.lang.String generate(java.lang.String subject,
java.lang.Object payload,
java.util.Date createdDate,
java.util.Date expirationDate)
Generates a JWT from the payload
subject - the JWT subjectpayload - the JWT payloadcreatedDate - the creation DateexpirationDate - the expiration Datepublic <T> T parse(java.lang.String jwt,
kotlin.reflect.KClass<T> payloadClass)
Parses a JWT and return the contained bean. It throws TokenExpiredException if the token has expired.
jwt - payloadClass - public com.ufoscout.coreutils.jwt.JwtService getJwtService()