[GH-ISSUE #69] callback part via cURL #34

Closed
opened 2026-02-27 19:25:43 +03:00 by kerem · 3 comments
Owner

Originally created by @dayeggpi on GitHub (Mar 3, 2017).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/69

Hi,

Is there anyway of handling the callback part via cURL and not with
header('Location: ' . $session->getAuthorizeUrl($scopes));
This would allow the use of the script into mobile and other application that don't handle very well the redirection part...

Or is there a way to make a cURL call on a page.php that use this wrapper ? at the moment the cURL response is 302 as it redirects to the spotify authorize page...

Thanks !

Originally created by @dayeggpi on GitHub (Mar 3, 2017). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/69 Hi, Is there anyway of handling the callback part via cURL and not with `header('Location: ' . $session->getAuthorizeUrl($scopes));` This would allow the use of the script into mobile and other application that don't handle very well the redirection part... Or is there a way to make a cURL call on a page.php that use this wrapper ? at the moment the cURL response is 302 as it redirects to the spotify authorize page... Thanks !
kerem 2026-02-27 19:25:43 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jwilsson commented on GitHub (Mar 3, 2017):

Hmm, the callback part can be handled however you like. The user will, however, always be redirected back to the callback URL. But you can send the user to Spotify's authorization page anyway you like.

Some more info about the whole flow: https://developer.spotify.com/web-api/authorization-guide/#authorization-code-flow

<!-- gh-comment-id:283945330 --> @jwilsson commented on GitHub (Mar 3, 2017): Hmm, the callback part can be handled however you like. The user will, however, always be redirected back to the callback URL. But you can send the user to Spotify's authorization page anyway you like. Some more info about the whole flow: https://developer.spotify.com/web-api/authorization-guide/#authorization-code-flow
Author
Owner

@dayeggpi commented on GitHub (Mar 3, 2017):

so technically, there is no way to have :

http://mysite.com/index.php : with this wrapper coded, to fetch an artist page link, for example)

then

http://hissite.com/curl.php : calling the above link in curl, to get the artist page link as a response (dom parser etc for example)

I guess it is not possible since at some point, there will be a redirection to Spotify auth page.
Unless it is possible to do so via cURL ?

<!-- gh-comment-id:283960641 --> @dayeggpi commented on GitHub (Mar 3, 2017): so technically, there is no way to have : http://mysite.com/index.php : with this wrapper coded, to fetch an artist page link, for example) then http://hissite.com/curl.php : calling the above link in curl, to get the artist page link as a response (dom parser etc for example) I guess it is not possible since at some point, there will be a redirection to Spotify auth page. Unless it is possible to do so via cURL ?
Author
Owner

@jwilsson commented on GitHub (Mar 5, 2017):

If you don't need any user data, the Client Credentials Flow can be used without any redirects.

If you need user data, I don't think it's possible to do it just via cURL.

<!-- gh-comment-id:284217490 --> @jwilsson commented on GitHub (Mar 5, 2017): If you don't need any user data, the [Client Credentials Flow](https://jwilsson.github.io/spotify-web-api-php/authorization.html#client-credentials-flow) can be used without any redirects. If you need user data, I don't think it's possible to do it just via cURL.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#34
No description provided.