mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 07:55:49 +03:00
[GH-ISSUE #198] Access Spotify Web API PHP via JS Fetch API #134
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#134
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 @brandonmcconnell on GitHub (Jul 12, 2020).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/198
I'm calling out to my own
request.phpfile from my homepage on the same domain (index.php), but I get the JS error in my console:GET https://…/request.php net::ERR_CERT_INVALID (anonymous) @ VM52:1I expected this to work without error, but when I visit my
request.phpdirectly in a new incognito window, I am prompted once again to authenticate with Spotify. How can I permanently authenticate myself (more than auth flow) so that anyone visitingrequest.phpwould see my Spotify information, not their own?Thanks in advance, and thanks for organizing this robust API. It's made my work on this project much simpler. 🙌🏼
@jwilsson commented on GitHub (Jul 12, 2020):
Hey!
The first error seems to be caused by an invalid TLS certificate, are you running it over https?
If you want to stay permanently authenticated, you’ll first need to obtain access and refresh tokens for your account and store them somewhere. Then each time someone visits the page you’ll have to check if the access token is still valid and if not, request a new one using the refresh token. And then request the other info you want.