如何生成soundcloud oauth令牌(访问令牌) [英] how to generate soundcloud oauth token (access token)
问题描述
我有一个asp.net Web应用程序,尝试使用此方法在Soundcloud上上传曲目:
I have an asp.net web application where I am trying to upload tracks on Soundcloud using this method: Connecting to and uploading tracks with Soundcloud API using C# .NET
我在soundcloud上创建了一个应用,但我不知道如何生成我的oauth令牌[oauth_token]
I created an app on soundcloud but I don't know how to generate my oauth token [oauth_token]
谢谢
推荐答案
oauth令牌是每位用户授权您的应用后获得的东西.对于服务器端Web应用程序,您可以使用应用程序的API凭据将用户重定向到SoundCloud授权URL,以便他们可以登录并批准您的请求.
The oauth token is something you get per user after they authorize your app. For server-side web applications, you use the API credentials for your app to redirect the user to the SoundCloud authorization URL so they can login and approve your request.
当他们批准您的授权请求时,它们将被发送到注册应用程序时指定的 redirect_uri
.此响应中有一个代码(查询字符串中为 code
),您将使用该代码交换所需的oauth令牌(在本例中,其称为 access_token
).然后,您需要保存与该用户关联的 access_token
.
When they approve your authorization request, they are sent to the redirect_uri
you specified when registering your app. There is a code in this response (code
in the querystring) that you will exchange for the oauth token you want (in this case its called access_token
). Then you need to save off that access_token
(associated with that user).
我最近用 C#
代码创建了一个SO帖子,详细说明了如何执行此操作:
I recently created a SO post with C#
code detailing how to do this: How to let users login to my site using SoundCloud. You can also use this as an authentication method for your website (also what the post is about).
这篇关于如何生成soundcloud oauth令牌(访问令牌)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!