没有Web浏览器的Soundcloud API身份验证 [英] Soundcloud API authentication without a web browser

查看:141
本文介绍了没有Web浏览器的Soundcloud API身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Soundcloud XBMC插件.该附加组件是开源的,并且是用Python编写的.我想允许用户通过附加组件登录到他们的SoundCloud帐户,但是有可能使XBMC实例在环境中运行而无需访问典型的Web浏览器(例如

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?

推荐答案

它们的API中未提供此功能,但是在深入研究库后,我发现了它. 进行POST到:https://api.soundcloud.com/oauth2/token

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

具有这些参数

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.

这篇关于没有Web浏览器的Soundcloud API身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆