Skip to content
seyyed edited this page Aug 7, 2021 · 2 revisions

this interface used for working with json web token and implemented in json web library

methode

BaseDTO generateJwt(JwtObjReqVM jwtObjReqVM, String secretKey, SignatureAlgorithm signatureAlgorithm);

create a jwt with your secretKey for sign json web token

BaseDTO generateJwt(JwtObjReqVM jwtObjReqVM);

create a jwt with default secret Key uoy can change it by change your properties json.web.toke.secretKey=123

BaseDTO isTokenWithoutCheckExpireTime(String jwt, String secretKey);

this method used for validate a jwt token without check expire time just check jwt signing

BaseDTO isValid(String jwt, String secretKey);

this method validate jwt and return a boolean

BaseDTO isValidWithoutCheckExpireTime(String jwt);

this method validate jwt and return a boolean

BaseDTO isValid(String jwt);

jwt is your input jwt

return Boolean for process

secret key is a default field in your application properties

BaseDTO getJwtBodyWithoutCheckExpireTime(String jwt);

jwt is your input jwt

return object of claims that is your json body

secret key is a default field in your application properties

this method not validate expireTime

< R > BaseDTO< R > getJwtParam(String jwt, String paramName, Class< R > tClass);

jwt is your input jwt

paramName is your key that you want fetch from claims

tClass is object that you want cast to it

< R > the class type

Clone this wiki locally