Doing my own project and trying to automate the process of updating a playlist I own.
I've created an AWS Lambda that every week, at a certain time starts to run and retrieves the last added songs from one playlist and then updates the second playlist with these songs.
Since I don't have a user interface for the user to log in (It's my playlists) I used Client Credentials Flow
After retrieving the token, and reading the last tracks added to the playlist I tried to use the token to update the second Playlist which failed with 403 and a message 'This request requires user authentication.'.
I've tried to add the post call of 'https://accounts.spotify.com/api/token' the scope param of 'playlist-modify-private playlist-modify-public user-library-read' which didn't help 😞
My question is:
Is what I'm trying to achieve possible without the user logging in using a web/mobile interface?
Solved! Go to Solution.
The only way to get a code to request a token the server can read and modify playlists with, is to use a browser to login once.
After that, you can use refresh tokens to get new tokens, as it's described at the Authorization Code Flow page.
There's no way around it.
Note: I'm saying a browser. It doesn't need to be a browser on your server. The only thing the server needs to do, is handle the callback when you go with a browser to that modified URL I mentioned earlier and log in.