Reputation: 93
I'm trying to access Spotify web API (following this documentation: https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow). I just need to access public data, like album names and cover art. To access that, I don't need any user scope, so I think the best approach is "Authorization code" with no scope specified.
The onlye examples I've found use client credentials, and user scopes, so it's mandatoryfor the user to give access. But in this case, it shouldn't be.
I've managed to get a response from my get request, but it's an html page, so I need to use an http server and listen to httpServer.OnAuth. This causes a web browser to open, and the user to accept the access, but I think this wouldn't have to be necessary for public access.
So, my question is... Is there any way to get authorization to query the spotify web api for public data, without the user to perform any action? Maybe with web requests and responses? Or maybe even with a totally different approach to access these spotify public data... I'm confused, I think this should be possible!
Thanks for your time!
Upvotes: 1
Views: 1757
Reputation: 20324
I have just recently done the same thing myself, and like you I was also a bit confused with how to query the Spotify API without having a user to enter his/hers credentials. And what confused me, was the naming of the different authorization flows: authorization code, client credentials, and implicit grant. As soon as you realize that client in client credentials isn't a client as in a user, but a client as in the application you're developing, it get's much more clear.
The process is pretty well described here: https://developer.spotify.com/web-api/authorization-guide/#client-credentials-flow
But in short, these are the steps you need to go through:
Upvotes: 2