Interface JWTService
- All Known Implementing Classes:
JWTServiceImpl
public interface JWTService
Generates JWT tokens with preconfigured expiration times for access and refresh flows.
-
Method Summary
Modifier and TypeMethodDescriptiongenerateAccessToken(String subject) Generates an access token with short-lived expiration.generateAccessToken(String subject, Map<String, Object> claims) Generates an access token with short-lived expiration.generateRefreshToken(String subject) Generates a refresh token with extended expiration.generateRefreshToken(String subject, Map<String, Object> claims) Generates a refresh token with extended expiration.parseClaims(String token)
-
Method Details
-
generateRefreshToken
Generates a refresh token with extended expiration.- Parameters:
subject- the subject of the token- Returns:
- signed JWT refresh token
-
generateRefreshToken
Generates a refresh token with extended expiration.- Parameters:
subject- the subject of the tokenclaims- additional claims to include in the token- Returns:
- signed JWT access token
-
generateAccessToken
Generates an access token with short-lived expiration.- Parameters:
subject- the subject of the token- Returns:
- signed JWT access token
-
generateAccessToken
Generates an access token with short-lived expiration.- Parameters:
subject- the subject of the tokenclaims- additional claims to include in the token- Returns:
- signed JWT access token
-
parseClaims
- Parameters:
token- the JWT token to parse- Returns:
- map of claims extracted from the token
-