Soundcloud API authentication without a web browser

对着背影说爱祢 提交于 2019-12-18 13:15:28

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/14449508/soundcloud-api-authentication-without-a-web-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!