rinukkusu / spotify-dart

A dart library for interfacing with the Spotify API.
BSD 3-Clause "New" or "Revised" License
206 stars 93 forks source link

[Question]: Is it possible to have my flutter client read data from my own account #196

Open NonymousMorlock opened 9 months ago

NonymousMorlock commented 9 months ago

I guess what I'm trying to ask is, with the currently available auth flows, it seems impossible to authenticate and initialize a Spotify object without redirecting users to login to their own spotify account, which I don't want as everything I'll be doing will be reading data from "MY" own developer account and I don't need anything from user's account. even with the oauth, I still need to get credentials, and to do that, I'll need the access and refresh tokens which I can only get from user's redirect. Please how can I programmatically authenticate a session with My own credentials behind the scenes without having user go through any authentication

rinukkusu commented 9 months ago

You should be able to use the "Client Credentials" flow and only use the ClientId and ClientSecret for your app. As you stated, you will not be able to access user related data, as explained here.

If you actually want to access data from your own user account, you will still need to do the OAuth flow. I wouldn't put these credentials in an app, that get's deployed to user devices, though, since a crafty user could extract your personal access- and refresh tokens and do something bad.

See this Spotify Community Question for a solution idea.