-
jwt 오류 ) hmac 알고리즘으로 인한 오류web( jsp, servlet )/jsp 2024. 7. 16. 15:21
직접 암호화 키를 만들어서 적용시켜보려고 했는데 500에러가 나왔다.
에러 메시지는 아래와 같았다.The specified key byte array is 104 bits which is not secure enough for any JWT HMAC-SHA algorithm. The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HMAC-SHA algorithms 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#secretKeyFor(SignatureAlgorithm) method to create a key guaranteed to be secure enough for your preferred HMAC-SHA algorithm. See https://tools.ietf.org/html/rfc7518#section-3.2 for more information.HMAC-SHA 알고리즘은 KEY 사이즈가 256비트(32바이트)보다 커야한다.
영어는 한 글자당 1바이트이다.
(한글은 2바이트)
적어도 32글자 이상의 글이 있어야한다.
'web( jsp, servlet ) > jsp' 카테고리의 다른 글
JSTL 오류 ) javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach> (0) 2024.07.28 JSTL 과 EL(Expression Language)으로 다르게 "출력"해보자 (2) 2024.07.24 JWT란? (2) 2024.06.11 JWT import가 안되는 경우 (0) 2024.06.09