mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-26 23:45:49 +03:00
[GH-ISSUE #252] Auto-Refreshing access token. #182
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#182
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @scoder21 on GitHub (Jul 20, 2022).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/252
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
@jwilsson commented on GitHub (Jul 21, 2022):
Hey!
You still need
callback.phpfor 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 yourSessioninstance 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.
@scoder21 commented on GitHub (Jul 21, 2022):
Okay, if I have other questions, I will get back to you.
Thanks for the quick response!