9주차 미션 [나루]#39
Open
yangjiae12 wants to merge 3 commits into
Open
Conversation
Open
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚩 관련 이슈
📌 구현 결과
1. JWT 기반 인증 구조 추가
application.yml에 JWT 관련 설정을 추가했습니다.JwtUtil을 통해 Access Token과 Refresh Token을 생성하도록 구현했습니다.JwtAuthFilter를 추가하여Authorization헤더의 Bearer 토큰을 검증하도록 구현했습니다.SecurityContextHolder에 인증 객체를 저장하도록 처리했습니다.2. 로그인 성공 시 JWT 토큰 반환
/auth/loginJSON 로그인 API를 추가했습니다.AuthenticationManager기반으로 로그인 처리를 구현했습니다.grantTypeaccessTokenrefreshTokenaccessTokenExpiresIn/login성공 응답에도 동일하게 JWT 토큰 정보가 포함되도록 수정했습니다.3. 마이페이지 조회 API 개선
userId를 직접 전달해야 했습니다.@AuthenticationPrincipal을 사용하여 인증된 사용자 정보를 가져오도록 수정했습니다.Authorization: Bearer {accessToken}헤더만 전달하면 본인의 마이페이지 정보를 조회할 수 있습니다.4. 검증 결과
./gradlew compileJava실행 결과 정상적으로 빌드되는 것을 확인했습니다.❓ 리뷰 요청
role,authorities정보를 포함하고, Refresh Token에는 최소 정보만 포함하도록 구현했는데 토큰 claim 구성이 적절한지 확인 부탁드립니다./login과 JSON 로그인/auth/login모두 JWT 토큰을 반환하도록 구현했는데, 두 로그인 방식을 함께 유지하는 구조가 적절한지 의견 부탁드립니다.🤔 질문
accessTokenExpiresIn을 응답에 포함했는데, 이 방식이 일반적인지 궁금합니다./auth/reissueAPI를 추가할 때 어떤 예외 케이스를 우선적으로 고려해야 할지 궁금합니다.💬 기타 공유 사항
JWT_SECRET_KEY는 환경변수로 관리하도록 설정했습니다.JWT_SECRET_KEY를 추가해야 정상 실행됩니다.