I am working on a Soundcloud XBMC add-on. The add-on is open source, and written in Python. I would like to allow users to login to their SoundCloud account via the add-on, however it's possible to have XBMC instances running in an environment without access to a typical web browser (e.g. raspbmc
, which provides no window manager or graphical browser by default). Is there a way to still allow users to authenticate with this add-on without requiring use of the 'SoundCloud Connect Screen' and without violating the SoundCloud API TOS?
To access the SoundCloud® API, you will first need to register your app at https://soundcloud.com/you/apps using your SoundCloud® account. When you've done that, we'll issue you with a client ID and client secret. Your client ID is required for all calls to the SoundCloud® API.
If the user is already signed into SoundCloud, they will be able to authorize your request in one click. Users of your app will be redirected to the SoundCloud Connect screen. If the user approves your authorization request, they will be sent to the redirect_uri you specified when registering your app.
You don't generate it on yourself, you get it from the SoundCloud API. You have first to authorize with your client_id, client_secret and a redirect_url then in the redirect_url (which the soundcloud server will call it should be some script on your server) you can get the token from the GET parameter "code".
You need to get your client_id and client_secret by registering your app here. After you have obtained that, you can start using the API. Basically, most of the calls will look like this one: final SoundCloud api = new SoundCloud.
This is not provided in theirs API, but after some digging into the libraries i figured it out.
Make a POST to: https://api.soundcloud.com/oauth2/token
with these params
grant_type=password&client_id=YOUR_CLIENT_ID&client_secret=YOUR_SECRET_ID&username=USERNAME&password=PASSWORD&scope=non-expiring
this will return non expiring token that you can use for future authenticated requests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With