Class JwtUtils

java.lang.Object
com.bytedesk.core.utils.JwtUtils

@Component public class JwtUtils extends Object
https://github.com/jwtk/jjwt#jws-create-key
  • Field Details

    • jwtSecret

      @Value("${bytedesk.jwt.secret-key}") private String jwtSecret
    • jwtExpirationMs

      @Value("${bytedesk.jwt.expiration}") private long jwtExpirationMs
  • Constructor Details

    • JwtUtils

      public JwtUtils()
  • Method Details

    • generateJwtToken

      public String generateJwtToken(String username, String platform)
      https://github.com/jwtk/jjwt?tab=readme-ov-file#creating-a-jwt
      Parameters:
      username -
      Returns:
    • validateJwtToken

      public boolean validateJwtToken(String authToken)
    • getSubjectFromJwtToken

      public String getSubjectFromJwtToken(String token)
    • secretKey

      private SecretKey secretKey()