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

Web SDK Invalid Scope

Web SDK Invalid Scope

Plan

Premium Student

Country

United Kingdom

Device

Desktop

Operating System

Windows 10

My Question or Issue

 

Hi all, I am trying to follow the Web SDK guide https://developer.spotify.com/documentation/web-playback-sdk/tutorials/getting-started

 

However I am running into an issue where I get the following console errors:

I am a premium user, and I am using the following scopes:

"user-read-private",
"user-read-email"
"user-top-read"
"streaming"
"user-modify-playback-state"
"app-remote-control"

 

I've tried to add the scope that it seems to be trying to call "web-playback", but then get an illegal scope error. When using the authentication token provided on the actual tutorial page, the app seems to work, it's just when I generate the token myself. The only difference I can see between my scopes and the one the tutorial uses is "openid", however this also returns an illegal scope when I use it.

 

Has anyone also encountered this error? I'm programming using Python Flask, and making a manual requests call to get the authentication token. Below is how I am authenticating

 

 

 

 

 

 

@auth_blueprint.route('/auth/login')
def login():
    sp_oauth = spotipy.oauth2.SpotifyOAuth(
        client_id=SpotifyCreds.CLIENT_ID,
        client_secret=SpotifyCreds.CLIENT_SECRET,
        redirect_uri=config.HOSTNAME + url_for("auth_blueprint.callback"),
        scope=",".join(SpotifyCreds.SCOPES)
    )
    auth_url = sp_oauth.get_authorize_url()
    return redirect(auth_url)


@auth_blueprint.route('/auth/callback')
def callback():
    authorization_code = request.args.get('code')

    if auth_service.callback(authorization_code):
        return redirect(url_for("main_blueprint.home"))
    else:
        return redirect(url_for("auth_blueprint.login"))

 

 

 

Many thanks for anyone that's taken a look into this!

 

Reply
8 Replies

Please ignore this, I figured out how to edit the original post after confirming my email 🙂

Okay. Did you also find this issue ont GitHub: https://github.com/spotify/web-playback-sdk/issues/11

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Hi, thanks for replying. I did read that and used the new scopes listed in the latest comment, however unfortunately still no luck.

Are you using a user with a premium account, or a user with a free account?  The error you've provided indicates perhaps that it's a user with a free account?  

Hi, I'm using a paid Spotify student account, so I feel like the error is just a default one after the invalid token scopes error.

Oh - your scopes are supposed to be space delimited not comma delimited.  Try  " ".join(SpotifyCreds.SCOPES) 

Did you ever get this fixed? I'm currently having the same issue and it's driving me nuts

Same, I cannot get this to work . . . ! It's crazy annoying.

Suggested posts