Suppose my user logged in and I gave him 2 tokens ; access and refresh token
access token is valid for 15 minutes and refresh token is valid for 1 week
We don't want to give them only access token valid for a long period since someone can obtain that access token and make requests with it, that's why we are making it valid for 15 minutes.
However, can't our refresh token also be stolen ? Someone can obtain our refresh token and gets an access for 1 week ? So why do we give two different tokens and implement access-refresh based token authentication if both of them are subject to danger ?