토큰 인증 로그인방식을 적용하고 있는데.. 다음과 같은 에러가 발생했다.

[2023-08-14 13:51:27.493] [ERROR] [http-nio-8081-exec-6] 
com.springboot.security.controller.SignController ExceptionHandler 호출,null,
The signing key's size is 56 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.

엄청 많은 말이지만 결국은.. 시크릿키가 너무 짧으니 재검토를 고려해보라는 뜻이다.

(고려해보라고하면 단순 경고같지만 에러가 뜨니 안 바꿀수가 없는 노릇)

내 시크릿키는 이러했다.

## JWT auth key

springboot.jwt.secret=ohks486

참 심플하지 않은가? 해서 이런식으로 엄청 길게 바꾸었다.

## JWT auth key

springboot.jwt.secret=Q4NSl604sgyHJj1q5wEkR3ycUeR4uUAt7WJraD7EN3O9DVM4yyYu7xMEbSF4XXyYJkal13eqgB8F7Bq4H

자 다시 로그인을 해보면..

JWT 로그인

음..매우 잘된다

+ Recent posts