Поясните почему ошибка при авторизации JWT
io.jsonwebtoken.security.WeakKeyException: The signing key's size is 96 bits which is not secure enough for the HS256 algorithm. The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HS256 MUST have a size >= 256 bits (the key size must be greater than or equal to the hash output size). Consider using the io.jsonwebtoken.security.Keys class's 'secretKeyFor(SignatureAlgorithm.HS256)' method to create a key guaranteed to be secure enough for HS256. See https://tools.ietf.org/html/rfc7518#section-3.2 for more information.
генерирую токен так:
public String doGenerateToken(UserDetails user) {
Claims claims = Jwts.claims().setSubject(user.getUsername());
claims.put("authorities", user.getAuthorities());
return Jwts.builder()
.setClaims(claims)
.setIssuer("akaleganov")
.setIssuedAt(new Date(System.currentTimeMillis()))
.setExpiration(new Date(System.currentTimeMillis() + SESSION_TIME))
.signWith(SignatureAlgorithm.HS256, SECRET_KEY)
.compact();
}
ругается на эту строку:
.signWith(SignatureAlgorithm.HS256, SECRET_KEY)
SECRET_KEY = "asdasdasd123ru"
поясните пожалста чего ему надо?