We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
변조된 토큰을 사용하는 경우. 토큰으로 아무 값이나 사용하는 경우. 토큰이 만료된 경우.
tokenProvider.getAuthentication(token)
LGTM-Backend/API-Server/src/main/java/swm/hkcc/LGTM/app/modules/auth/utils/jwt/JwtFilter.java
Lines 18 to 30 in 330785f
LGTM-Backend/API-Server/src/main/java/swm/hkcc/LGTM/app/modules/auth/utils/jwt/TokenProvider.java
Lines 94 to 109 in 330785f
simpleValidateToken(token)
@Override protected void doFilterInternal(HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException { String token = tokenProvider.resolveToken(request); // 토큰 문자열 형식에 대해 검증 ("Bearer xxxxx.xxxx.xxx") simpleValidateToken(token); // check access token token = token.split(" ")[1].trim(); Authentication auth = tokenProvider.getAuthentication(token); SecurityContextHolder.getContext().setAuthentication(auth); filterChain.doFilter(request, response); }
// 41xx : JWT Error JWT_SIGNITURE_ERROR(4003, HttpStatus.UNAUTHORIZED, "손상된 JWT 토큰입니다."), JWT_MALFORMED_ERROR(4004, HttpStatus.UNAUTHORIZED, "JWT 토큰이 올바르지 않습니다."), JWT_EXPIRED_ERROR(4005, HttpStatus.UNAUTHORIZED, "JWT 토큰이 만료되었습니다."),
The text was updated successfully, but these errors were encountered:
좋은 것 같습니다! 다만 지금 다른 기능 개발이 우선일 것 같아서, 일단 백로그에 남겨두는건 어떻까요??
Sorry, something went wrong.
넵 좋습니다~
No branches or pull requests
요약
변조된 토큰을 사용하는 경우.
토큰으로 아무 값이나 사용하는 경우.
토큰이 만료된 경우.
AS-IS
tokenProvider.getAuthentication(token)
에서 토큰 검증을 실행합니다.LGTM-Backend/API-Server/src/main/java/swm/hkcc/LGTM/app/modules/auth/utils/jwt/JwtFilter.java
Lines 18 to 30 in 330785f
LGTM-Backend/API-Server/src/main/java/swm/hkcc/LGTM/app/modules/auth/utils/jwt/TokenProvider.java
Lines 94 to 109 in 330785f
TO-BE
simpleValidateToken(token)
에서는 토큰 문자열 형식에 대해서만 검증을 실행합니다.tokenProvider.getAuthentication(token)
에서 종류에 맞는 예외 발생The text was updated successfully, but these errors were encountered: