mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-26 23:45:49 +03:00
[GH-ISSUE #221] How can I get the token without another ?code= forwarding? #156
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#156
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 @salimcansatici on GitHub (Jan 28, 2021).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/221
Hello there,
Localhost index.php gone to me
http://localhost/?code=AQBhex-8CF0Xv15HTgob5WesCOmnBTkGQ6QHVMgCwpgx5oXwwHgVMAMjxrCLS0UkQhLzPvd53syHgaf1bQlVrKo-RDNAv10s6pTQNZywdahkDXARJxR_jCHAnQXZiWUKHcfTsCB-nyQRu5PDx_zc7jQouX0rL63LER06XHIdWPrTKQse0jUFBcWh51-4jMadu6Uholi3lxPy3_TcDXObDzs1vwWjx9WiB_cmzmybas a URL redirect.### How can I get the token without another forwarding?
I want to be shown what I listened to when visiting the site.
Thanks to you, I can get the information about which music I'm listening to. But when I visit the site, I want other users to see this from my own token.
Where can I store this token? I have read the document but could not understand it. Could you please give me some guidance?
My code is;
Thanks,
@jwilsson commented on GitHub (Jan 28, 2021):
Hi!
After requesting the tokens, you'll need to save the access and refresh tokens somewhere persistent. This could be in a database, a file on disk, or somewhere else as long as it's secret and safely stored so no one else can access it. It's really up to you to decide what's the best approach to saving the tokens.
Then, whenever someone visits your site and you want to display the image you need to first retrieve the tokens and tell the API-wrapper about them. The Authorization Code Flow guide should provide some guidance on this and how to split things into multiple files.