Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Invalid Token Scopes (Web Playback SDK)

Invalid Token Scopes (Web Playback SDK)

Plan

Premium

Country

UK

 

 

 

My Question or Issue
I'm able to successfully generate an access token for the following scopes:
playlist-read-private streaming app-remote-control user-modify-playback-state user-read-playback-state user-read-recently-played user-read-private

However, when using said access token in the web playback SDK, I consistently get an "Invalid token scopes" when attempting playback.

The access token looks like the following:
BQBLSGZxJxOlIcI_yxo_shQzuMeZD_1Qz66XcOXJ8iz0Q7uErq-qcJ_AiC2JJwc37by3z4uscjhsfQWAg7OxCW1ENdsnwvTvknYBletZI84uIG0PAy7hTZhObFiINdv4tAxMTJQZgQxMj0B_SubF4X4g61m_PNkWPpoDbKBL-VHGCu7FSJcdJQizWh0mpdXZX0tWLhrAPd0yRgFqE3HwOsvY6GtT7aRW

And i'm even able to transfer playback to my device and get the device ID. 

I'm at a complete loss as to what's wrong - any help would be massively appreciated!


 

Reply
5 Replies

For playback you only really need the streaming and user-read-private scopes, and you have both of those.  Your scopes as listed are correct, have you re-authenticated your user (got entirely new tokens - access and refresh) since you updated your scopes?  When you get a token it helps to save all the token data somewhere, as the token response itself will also show the scopes of the token.

Oh, actually you are missing user-read-email I think that's also required.

Hey! I was so looking forward to telling you this was the solution, but unfortunately not - the issue persists with the added user-red-email scope. I can confirm that all of the scopes are being applied, based off the response from the token endpoint.

What's so strange is that I get a 204 response, when I use my access token to call the play endpoint with the web API, but I get either "Playback error" or "Invalid token scopes" (or both) from the Web Playback SDK. Do you have anymore thoughts? What could I show you to make this easier?

I would have to see your code to understand what's happening for you.  I can replicate getting an authentication error of "Invalid token scopes" if I'm missing all three of the needed scopes, but with them it does not give an error.

Did you definitely create a new token by going through the authentication process after adding the user-read-email scope?

Thanks tomjaimz,

I've sent you a pm with links to code. We can share anything discovered back here if it'll help someone else. And yes, definitely.

Suggested posts