0

Is there a way to get the OAuth token programmatically from the console? We can only manually get it (through the cookies once logged in), but each Soundcloud request on the website we are building requires a new token which cannot be generated automatically when we manually extract it. Anyone who can help?

*It looks like Soundcloud is not accepting app applications at the moment, so we already know about the solution from the answers in this thread

Emma
  • 25
  • 7
  • If the cookie is marked as HttpOnly, you cannot extract it with Javascript, by design. If it's _not_ marked as such, it's in `document.cookies`. – Evert Dec 23 '20 at 07:48
  • For security reasons, I don't believe that this is possible. Not sure why you even need to use a console. Most OAuth UIs I've worked with show up in a separate browser window and use a redirect Uri to to send the token to, which is usually your backend. – Johann Dec 23 '20 at 08:09
  • @AndroidDev For example, in order to get the duration of a podcast to show up on the website, we need to send a request to SoundCloud to get the details of that podcast. In that request we need to send the client id and OAuth token which is generated for that request - hence why we need it to generate automatically from the console, rather than manually extracting it. – Emma Dec 24 '20 at 02:36
  • @Emma I'm pretty sure you're doing something wrong. There should be no need to send a client id with an OAuth token. The client id is automatically retrieved on the backend when you supply the token. Also, tokens are normally meant to have a long expiry date such as 30 days or more. Requiring a new token for every single call is ridiculous for a service like SoundCloud. I could imagine that for a banking app but not for something like SoundCloud. Have you actually tried reusing the same token every time without having to request a new one? – Johann Dec 24 '20 at 08:32

0 Answers0