Closed scoder21 closed 2 years ago
Hey!
You still need callback.php
for the initial access token request. But afterwards the user won't be redirected anymore, the refresh token returned from Spotify will be used to automatically request new access tokens in the background when the previous access token has expired. You will need to keep track of the refresh token so it can be used to request a new access token. And be sure to grab the refresh token from your Session
instance after each call since it might have requested new tokens and given you a new one (the docs linked below has some examples).
There's some more docs specifically on refreshing access tokens, but do let me know if you have any other questions.
Okay, if I have other questions, I will get back to you. Thanks for the quick response!
Hey @jwilsson!
I have some questions about the auto-refreshing access token system.
When using it, does it replace the "callback.php" file or is that a different one? The flow I'm talking about: https://github.com/jwilsson/spotify-web-api-php/blob/main/docs/examples/access-token-with-authorization-code-flow.md
When using it, do you need to keep track of the time or redirect the user manually or is it really all done "automatically"?
I hope to hear from you soon.
Kind Regards