-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feature] 로그아웃, 토큰 재발급 #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다~!
refreshToken = extractToken(refreshToken); | ||
accessToken = extractToken(accessToken); | ||
|
||
validateAccessTokenExpired(accessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AccessToken 유효성검사를 하는 메서드로 보이는데 맞을까요?
아니면 Access token이 진짜 만료되었는지 체크하는껄까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access Token이 진짜 만료되었는지 체크하는 메서드입니다. Refresh Token을 얻은 공격자가 재발급을 통해 Access Token을 탈취하는 것을 방지하고자 넣은 로직입니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이해했습니다 그렇게 악용될 수 도 있겠네요!
|
||
public void reissue(String refreshToken, String accessToken, HttpServletResponse response) { | ||
refreshToken = extractToken(refreshToken); | ||
accessToken = extractToken(accessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
매개변수에 재할당보다는 새롭게 변수를 만들어주는게 좋을 것 같아요!
validateAccessTokenExpired(accessToken); | ||
String providerId = jwtTokenProvider.parseExpiredToken(accessToken).getSubject(); | ||
|
||
validateRefreshToken(refreshToken, providerId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[OPTIONAL]
Token이라는 도메인 class를 만든다면 validate 하는 부분을 도메인 class에 넣어서 캡슐화시킬 수도 있을 것 같네요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원래 토큰 담당자가 JwtTokenProvider인데, 여기에다가 validate 하도록 수정할까요?
충돌나는 부분 수정해두었습니답 |
✏️ Description
🙏🏻 To Reviewers
💡 Issue Number