DefaultJwtProvider

class DefaultJwtProvider(secretKey: SecretKey, accessTokenExpire: Long, refreshTokenExpire: Long) : AbstractJwtProvider

Implementation of AbstractJwtProvider with functions related to JWT authentication. The JWT authentication function is implemented based on Default JWT Authentication.

Throws

Constructors

Link copied to clipboard
constructor(secretKey: SecretKey, accessTokenExpire: Long, refreshTokenExpire: Long)

Functions

Link copied to clipboard

Method to generate access token.

Link copied to clipboard

Method to generate refresh token.

Link copied to clipboard
fun createToken(authentication: JwtAuthentication, expire: Long): Token
fun createToken(payload: Map<String, String>, expire: Long): Token

Variant of JwtProvider.createToken using secretKey.

open override fun createToken(authentication: JwtAuthentication, expire: Long, secretKey: SecretKey): Token
open override fun createToken(payload: Map<String, String>, expire: Long, secretKey: SecretKey): Token
open override fun createToken(header: Map<String, String>, payload: Map<String, String>, expire: Long, secretKey: SecretKey): Token

Implementation of JwtProvider.createToken.

Link copied to clipboard
Link copied to clipboard
open override fun getHeader(token: Token): Map<String, String>

Implementation of JwtProvider.getHeader.

Link copied to clipboard
open override fun getPayload(token: Token): Map<String, String>

Implementation of JwtProvider.getPayload.

Link copied to clipboard
fun refresh(refreshToken: Token): Pair<Token, Token>

Method to perform refresh through refresh token.