[GH-ISSUE #106] CronJob Problem #63

Closed
opened 2026-02-27 19:25:51 +03:00 by kerem · 1 comment
Owner

Originally created by @tma-bhr on GitHub (Nov 13, 2017).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/106

Hello I am trying to make an app which is getting users Current Track and set it is a status in a differenet platform.
Is there a way to save some "token" and make this code called after x minutes. Because Spotify uses oAuth user must log in and login again for using app.

I will use $api->getMyCurrentTrack() function to get current track. But also I need to make setAccesstoken which I am going to save in DB.
What can be auth method for this ?

Originally created by @tma-bhr on GitHub (Nov 13, 2017). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/106 Hello I am trying to make an app which is getting users Current Track and set it is a status in a differenet platform. Is there a way to save some "token" and make this code called after x minutes. Because Spotify uses oAuth user must log in and login again for using app. I will use $api->getMyCurrentTrack() function to get current track. But also I need to make setAccesstoken which I am going to save in DB. What can be auth method for this ?
kerem 2026-02-27 19:25:51 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jwilsson commented on GitHub (Nov 15, 2017):

Hi!
After authenticating the user the first time, you'll get a refresh token which can later be used to refresh the access token without any user interaction.

So, save the refresh token together with the access token in your DB and refresh when necessary.

<!-- gh-comment-id:344487321 --> @jwilsson commented on GitHub (Nov 15, 2017): Hi! After authenticating the user the first time, you'll get a [refresh token](https://github.com/jwilsson/spotify-web-api-php/blob/master/docs/examples/access-token-with-authorization-code-flow.md#refreshing-an-access-token) which can later be used to refresh the access token without any user interaction. So, save the refresh token together with the access token in your DB and refresh when necessary.
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#63
No description provided.