Package org.localify.auth
Interface JwtService
- All Known Implementing Classes:
JwtServiceImpl
public interface JwtService
-
Method Summary
Modifier and TypeMethodDescriptiondecodeAuthStateJwt(String state) doRefreshToken(String token) Refreshes a token, invalidating the refresh token.doUserLogin(User user) Logs a user in.io.jsonwebtoken.ClaimsGets the claims associated with a token.
-
Method Details
-
getClaims
Gets the claims associated with a token. SeeJwtParser.parseClaimsJws(String)for more detailed exception information.- Parameters:
token- the jwt token- Returns:
- the Claims. Never null.
- Throws:
io.jsonwebtoken.JwtException- if the token is invalid in some way (see link above)IllegalArgumentException- if the token is null/empty/whitespace.
-
doUserLogin
Logs a user in. Generates new authentication and refresh credentials.- Parameters:
user- the user to generate credentials for.- Returns:
- a DTO containing the auth and refresh token.
-
doRefreshToken
Refreshes a token, invalidating the refresh token.- Parameters:
token- the refresh token- Returns:
- newly generated auth and refresh token
-
generateAuthStateJwt
-
decodeAuthStateJwt
-