Announcements
The Spotify Stars Program: Celebrating Values Week!

Help Wizard

Step 1

NEXT STEP

Who Me Too'd this topic

Error trying to refresh the access token

Hi, I am currently developing a mobile application that uses Spotify integration, as you may know when authenticating with spotify we receive an access token and a refresh token, the first one expires after an hour and the second one is used to request a new token.

 

From my mobile application I request the user to give me permissions to his spotify account, therefore, he enters his credentials and I receive the access token, refresh token and calculate at the time it will expire. These values are stored in my database in a secure way and are associated to the user, also they are used by my backend where I have a scheduled task that is responsible for automatically refresh the access tokens in case they are close to expire, to achieve this I must use the refresh token and the request responsible for doing so sometimes responds with these errors 500:

 

- Failed to remove token
- ECONNRESET

 

Therefore, the refresh token is revoked and my scheduled task cannot update the access token anymore.

 

Does anyone know why these errors occur?

 

Who Me Too'd this topic