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

애플 로그인 시 리프레시 토큰을 함께 보내주도록 구현 #569

Open
2 tasks
Mingyum-Kim opened this issue Sep 25, 2024 · 1 comment
Open
2 tasks
Assignees
Labels
BE 백엔드 관련 이슈입니다. 🌱 기능추가 feature (새로운 기능 구현)

Comments

@Mingyum-Kim
Copy link
Contributor

문제 정의

이 작업을 통해 해결하려는 문제를 정의하세요.

Access Token의 경우 만료 시간이 짧은 (1시간) 문제가 있습니다.
사용자가 앱 내에서 로그인 시간을 길게 가져가기 위해 refresh token을 활용할 계획입니다.

refresh token은 보통 2주 기간으로 만료 시간을 설정합니다. 예상되는 로그인 시나리오는 다음과 같습니다.

  • 로그인을 하고 refresh token과 access token을 전달 받는다.
  • refresh token의 경우 쿠키에, access token의 경우 로컬 스토리지에 저장한다.
  • access token의 만료 시간이 끝났을 때 요청을 보내면 401 에러가 발생한다.
  • 401 에러를 핸들링하여 refresh token을 사용해 재발급하고 로그인 과정 없이 서비스를 계속 이용할 수 있도록 한다.
  • 2주 이후 refresh token도 만료 되면 다시 로그인한다.

액션 아이템

문제를 해결하기 위해 필요한 액션 아이템을 입력하세요.

  • 로그인 시 refresh token를 함께 전달하도록 구현
  • access token 만료 시 refresh token 을 받아 재발급하는 기능 구현

내용

결과물, 참고사항 등을 입력하세요. (ex. PR, 문서 링크)

  • 추가로 refresh token이 탈취되는 시나리오에 대한 대비책도 만들 수 있습니다. 이는 Refresh Token Rotation이라는 방법으로 해결이 가능한데, 지금 말고 추후에 도입하도록 할게요 !
@Mingyum-Kim Mingyum-Kim added BE 백엔드 관련 이슈입니다. 🌱 기능추가 feature (새로운 기능 구현) labels Sep 25, 2024
@Mingyum-Kim Mingyum-Kim self-assigned this Sep 25, 2024
@Mingyum-Kim
Copy link
Contributor Author

지금 말고 로그아웃 + 회원 탈퇴 기능 구현하면 진행할게요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 관련 이슈입니다. 🌱 기능추가 feature (새로운 기능 구현)
Projects
None yet
Development

No branches or pull requests

1 participant