Class JwtTokenProvider
- java.lang.Object
-
- cz.zcu.students.cacha.bp_server.security.JwtTokenProvider
-
@Component public class JwtTokenProvider extends Object
Class providing utilities for jwt operations
-
-
Constructor Summary
Constructors Constructor Description JwtTokenProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
generateToken(org.springframework.security.core.Authentication authentication)
Generates new jwt login tokenLong
getUserIdFromJWT(String token)
Gets user id from given tokenboolean
validateToken(String token)
Gets whether given token is valid
-
-
-
Method Detail
-
generateToken
public String generateToken(org.springframework.security.core.Authentication authentication)
Generates new jwt login token- Parameters:
authentication
- authentication context- Returns:
- new jwt
-
validateToken
public boolean validateToken(String token)
Gets whether given token is valid- Parameters:
token
- jwt- Returns:
- whether given token is valid
-
-