How to authenticate Soundcloud API with redirect_uri (callback.html)

The ultimate goal is to give users the ability to upload / download files through the soundcloud API.

I registered my application, but now I have authentication problems. In the application registration, I have to define a redirect URI for authentication, by default it is callback.html. What is there to put?

I do not know what to add there, in the application uri redirection or in the code (provided that it should be the same) I tried to make callback.html myself, but it does not work. I'm starting to think that this should be an online link. But I only work on localhost ..

I found a very similar question here: redirect_uri and how to place callback.html in SoundCloud?

but he does not solve my problem.

I understand that this is a very simple material, but I hope I can get clear help. thank you very much

EDIT: for testing, I put http://www.samplewars.com/ in the redirect_uri registry and in redirect_uri in my code, and now I get a popup asking me to access the soundcloud account, after clicking it, it will shipped to samplewars.com. How to make it go to the same page (localhost address). Actually it is possible to set an offline link since I only work on localhost? I have nothing online.

+6
source share
2 answers

The reverse 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 can register another application that points to your local setting (for example, http://localhost/soundcloud-callback.html or something else).

If you are using the SoundCloud Javascript API, it is quite simple. Here is an example documentation page.

+3
source

in your windows/system32/drivers/etc/hosts file

add the line 127.0.0.1 localhost.samplewars.com and you can use this domain for testing purposes.

+1
source

Source: https://habr.com/ru/post/945354/


All Articles