Announcements

Help Wizard

Step 1

NEXT STEP

Creating playlist without any user interaction

Creating playlist without any user interaction

I'm developing an app that creates customized playlists for users. This shouldn't require the user to log-in with his Spotify account, so the playlists should be public for anyone to access. As far as I know, the Spotify API doesn't allow creating playlists without assigning them to a user account, so I would need to create a "system" account that owns all the playlists.

This is a problem for us, because we cannot use Client Credentials Grant to authenticate the backend anymore. Authorization Code Grant requires user interaction, which is not useful for server-to-server auth. We could authenticate once and then use the refresh_token to keep that access_token alive, but that's just a workaround, and could cause problems eventually. I also noticed Spotify API doesn't support "Resource Owner Password Credentials Grant", so I'm running out of options here.

I'd like to ask if anyone knows a better way to accomplish what I'm trying to do, without any kind of user interaction (no log-in in a browser). Is that possible?

Reply
1 Reply

If you've got an Access token and a Refresh token from the host account, and store them security (but editable for your server side script), your app can keep using them.

The only thing you have to make extra is a kind of admin page to get and store the tokens on your server, and a code that can refresh the access token if it's expired.

You can read more about the Authorization Code Flow on here: https://developer.spotify.com/documentation/web-api/tutorials/code-flow

Suggested posts