Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

의존성 업데이트로 인한 JWT 파싱 오류 수정 완료 #421

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies {
// Security
implementation 'org.springframework.boot:spring-boot-starter-security' // Spring Security
implementation 'com.warrenstrange:googleauth:1.5.0' // Google Authenticator
implementation 'io.jsonwebtoken:jjwt-api:0.11.5' // JWT 라이브러리
implementation 'io.jsonwebtoken:jjwt-api:0.12.6' // JWT 라이브러리
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6' // JWT 구현체
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6' // JWT Jackson 모듈

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public String resolveToken(HttpServletRequest request) {

public boolean validateToken(String token) {
try {
Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(token);
Jwts.parser().setSigningKey(key).build().parseClaimsJws(token);
return true;
} catch (io.jsonwebtoken.security.SecurityException | MalformedJwtException e) {
log.info("Invalid JWT Token");
Expand All @@ -128,7 +128,7 @@ public boolean validateToken(String token) {

public boolean validateTokenSilently(String token) {
try {
Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(token);
Jwts.parser().setSigningKey(key).build().parseClaimsJws(token);
return true;
} catch (Exception e) {
return false;
Expand All @@ -137,7 +137,7 @@ public boolean validateTokenSilently(String token) {

public Claims parseClaims(String accessToken) {
try {
return Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(accessToken).getBody();
return Jwts.parser().setSigningKey(key).build().parseClaimsJws(accessToken).getBody();
} catch (ExpiredJwtException e) {
return e.getClaims();
}
Expand Down