jsonwebtoken 버전 0.10.0+ 에서 로그인 TokenProvider에러 #48
fsoftwareengineer
announced in
오류/누락된 부분
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
jsonwebtoken 버전이 0.10.0인 경우 로그인시 아래와 같은 런타임 에러가 나는 것을 확인 할 수 있습니다.
이는 SECRET_KEY의 길이가 너무 짧아 그런 것 이므로 SECRET_KEY의 길이를 대략 40자 정도로 늘려 주시기 바랍니다.
예
마찬가지로 jsonwebtoken의 버전이 높을 시 Jwts.builder()의 .signWith이 deprecate된 것을 확인 할 수 있습니다.
.signWith
의 인자로 (SignatureAlgorithm, String) 대신 (Key, SignatureAlgorithm) 또는 (Key)를 넘겨주는 방법을 사용해야 합니다. 이를 위해 아래와 같이 기존의 SECRET_KEY를 이용해 Key를 생성하고 생성한 Key를 signWith에 대체 해 넘겨 주시기 바랍니다.TokenProvider.java의 create메서드
Beta Was this translation helpful? Give feedback.
All reactions