Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spotify Web API - Token Validation

Tags:

spotify

Given an auth token, originally received from Spotify Android/iOS SDK, I want to check with Spotify that the token I am holding is valid. Is there a minimal endpoint for doing this?

Ideally something not data-intensive, as I just want to know if the token is valid. This must be done with Web API and not SDK.

like image 668
Giannis Avatar asked May 30 '26 20:05

Giannis


1 Answers

There is no API endpoint for checking whether the access token is still valid. Usually you would store it along with the expires_in value that tells you until when it is valid.

An alternative is making a request to any endpoint from the Web API passing the access token. You will get a 401 Unauthorized status code back if the token has expired.

like image 87
José M. Pérez Avatar answered Jun 02 '26 20:06

José M. Pérez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!