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

Is a persistent user-scoped token possible?

Is a persistent user-scoped token possible?

Hey everyone, I am building a feature on my website that would render my top ten played songs from the Get User's Top Items endpoint. Right now it's working fine with my Bearer hardcoded as an environment variable, however, as soon as that expires my app completely breaks. I was curious as to if there was something similar to Twitter that will allow an app to be scoped to a user (the user that creates the application) however the tokens don't expire and are server to server only (so no OAuth flow).

 

I noticed the client credentials flow https://developer.spotify.com/documentation/general/guides/authorization/client-credentials/ existed, but it has a heavy emphasis on not having any user scope so naturally I haven't given this a go.

 

Thank you and happy new year.

Reply
1 Reply

The Authorization Code Flow and the Authorization Code Flow with Proof Key for Code Exchange both allow you to authorize with a specific user ("user-scoped token").  You can then refresh this token every hour without any user input. In that sense, the authorization never expires. Just read the authorization guide

Suggested posts

Staff
Let's introduce ourselves!

Hey there you,   Yeah, you! ๐Ÿ˜   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and getโ€ฆ

Staff
ModeratorStaff / Moderator/ 4 years ago  in Social & Random

Type a product name