✨ Feat: 회원 AccessToken 만료 시, RefreshToken 활용한 재발급 및 재로그인 유도 기능 구현#26
Merged
✨ Feat: 회원 AccessToken 만료 시, RefreshToken 활용한 재발급 및 재로그인 유도 기능 구현#26
Conversation
- JwtAuthenticationFilter -> MemberController -> MemberService - 회원 AccessToken 유효시간이 지나 프론트 단에서 reissue 엔드포인트를 호출합니다. - 만료된 AccessToken 및 회원 자격 증명을 Controller 단으로 넘기기 위해서 Filter 내에서 분기시킵니다. - USER 자격만 허용하는 reissue 엔드포인트 Controller에서 회원의 카카오 Id를 Service로 넘깁니다. - Service에서 refreshToken이 Redis DB 내에 존재하는지 체크합니다. - 유효한 refreshToken이 존재하는 경우 -> 새로운 회원 AccessToken과 RefreshToken을 발급하여 Update합니다. - 유효하지 않은 refreshToken인 경우 -> 예외를 반환하고, 재로그인을 유도합니다. issue #20
- AccessToken 및 RefreshToken 예외를 위해서 validate 메소드를 분리했습니다.(validateAccessToken, validateRefreshToken) - Subject 값을 UUID 랜덤 문자열로 저장해줌으로써 refreshToken이 동일하게 생성되는 이슈를 해결했습니다. - luckyMessageService 내의 luckyMessages 문자열 배열에 접근하기 위해서 Getter 어노테이션을 추가했습니다. - 테스트를 원활하게 진행하기 위해서 TypingController 단에서 authentication을 Service로 넘기도록 변경했습니다. issue #20
- refreshToken 활용하여 회원 AccessToken 재발급하는 테스트를 진행했습니다. - refreshToken이 만료된 경우, EXPIRED_REFRESH_TOKEN 예외가 발생합니다. - refreshToken이 유효하지 않은 경우, INVALID_REFRESH_TOKEN 예외가 발생합니다. - 모든 상황을 만족하는 경우, 새로운 AccessToken과 refreshToken을 발급하여 AccessToken은 반환, refreshToken은 redis에 업데이트합니다. issue #20
3 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.
#️⃣ 연관된 이슈
#20
📝 작업 내용
💬 리뷰 요구사항