Skip to content

토큰 사용방법을 모르겠어요 #107

Answered by mbkim95
kindkmj asked this question in Q&A
Discussion options

You must be logged in to vote

안녕하세요~
accessToken은 유효기간은 12시간 이고, refreshToken의 유효기간은 2달입니다. 그리고 refreshToken의 유효 기간이 1달 남은 시점부터는 refreshToken도 갱신됩니다. (참고: https://developers.kakao.com/docs/latest/ko/kakaologin/common#login)

accessToken을 어떻게 발급받는지에 대해서 문의주셨는데요, accessToken이 만료되고 refreshToken이 유효한 경우에는 kakao_flutter_sdk 내부에서 accessToken을 갱신합니다. 그리고 refreshToken과 accessToken이 둘 다 만료된 경우에는 sdk 내부에 저장된 토큰을 삭제하고 있습니다.

따라서 refreshToken의 존재 여부에 따라서 로그인을 수행해주면 되고, 별도로 accessToken의 갱신 로직은 따로 구현하지 않으셔도 됩니다.

그럼에도 직접 accessToken이 갱신을 구현하고 싶으시다면 AuthApi.refreshAccessToken()를 사용하시면 될 것 같습니다.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mbkim95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants