如何使用 redirect_uri (callback.html) 验证 Soundcloud API [英] how to authenticate Soundcloud API with redirect_uri (callback.html)

查看:67
本文介绍了如何使用 redirect_uri (callback.html) 验证 Soundcloud API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最终目标是让用户能够通过 soundcloud API 上传/下载文件.

The final goal is to let users be able to upload / download files through the soundcloud API.

我已经注册了我的应用程序,但现在我遇到了身份验证问题.在应用程序注册中,我必须定义一个重定向 URI 以进行身份​​验证,它们的默认值是 callback.html.自己放什么?

I have registered my app, but now I have got problems with the authentication. In the app registration i must define a redirect URI for authentication, their default is callback.html. What to put there myself?

我不知道在应用程序的重定向 uri 或代码中放什么(假设它必须相同)我试过自己制作 callback.html,但它不起作用.我开始认为它必须是一个在线链接.但我只在本地主机上工作..

I dont know what to put there, in redirect uri of the app or in the code (assuming it must be the same) I've tried making a callback.html myself, but it doesnt work. I'm starting to think it must be an online link. But i'm only working on localhost..

我在这里发现了一个非常相似的问题:redirect_uri 以及如何在 SoundCloud 上托管 callback.html?

I've found a very similar question here: redirect_uri and how to host callback.html on SoundCloud?

但它并没有解决我的问题.

but it doesnt solve my problem.

我意识到这是非常基本的东西,但我希望我能得到一些明确的帮助.非常感谢

I realize this is very basic stuff, but i hope i can get some clear help. thank you very much

为了测试,我将 http://www.samplewars.com/ 放入应用程序注册redirect_uri 和redirect_uri 在我的代码中,现在我得到弹出窗口,要求访问soundcloud 帐户,单击连接后,它转到samplewars.com.我如何使它转到同一页面(本地主机 url).实际上可以在那里放置一个离线链接,因为我只在本地主机上工作?我没有任何在线内容.

EDIT : for testing, i've put http://www.samplewars.com/ in the app registration redirect_uri and in the redirect_uri in my code, and now i get the pop-up asking for acces to the soundcloud account, after clicking connect it goes to samplewars.com. How do i make it go to the same page, (localhost url). Is actually possible to put an offline link there, as i'm only working on localhost? i dont have anything online.

推荐答案

回调文件用于将身份验证令牌发送回您的应用程序.在您的情况下,它应该类似于 http://www.samplewars.com/soundcloud-callback.html.对于开发,您可以注册一个指向您本地设置的不同应用程序(例如 http://localhost/soundcloud-callback.html 或其他).

The callback file is used to send the authentication token back to your application. In your case it should be something like http://www.samplewars.com/soundcloud-callback.html. For development, you could register a different application which points to your local setup (eg http://localhost/soundcloud-callback.html or whatever).

如果您使用 SoundCloud Javascript API,这相当简单.文档中有一个示例页面.

If you use the SoundCloud Javascript API, this is fairly simple. There's an example page in the documentation.

这篇关于如何使用 redirect_uri (callback.html) 验证 Soundcloud API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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