Search code examples
apiauthenticationtokenip-addresssoundcloud

POST Token stopped working: How could we generate a token passing the grant_type as password? Surpassing 401 Unauthorised - invalid_grant


Our authentication API call has failed since the morning of 20/03/2020.

We are getting an HttpStatus code 401 Unauthorized with an error message invalid_grant.

Here is the api call:

POST https://api.soundcloud.com/oauth2/token?client_id=[client_id]&client_secret=[client_secret]&grant_type=password&username=[username]&password=[password]

HEADER Content-Type: application/x-www-form-urlencoded

We have double checked all our credentials and everything else is still the same.

The request works when connected on VPN: Italy, France & Germany, but not on our Irish IP addresses.

Raised this issue with SoundCloud with a reply:

"SoundCloud does not have a dedicated API support team. Our customer support team are focused on providing account-related support and I am afraid we do not have the necessary skills to handle enquiries about SoundCloud’s API."

This morning, POSTMAN and the local environment started to work with an Irish IP Address but all our environments are still getting the same error.


Solution

  • After reading this post and its comments, you'd see that it has occurred before and one of the suggestions is to just use a non-expiring token.

    See this post to generate a non-expiring token.

    SoundCloud has no app support and no longer generates client id and secret. It's best to start looking for a different 3rd party provider.

    I don't know exactly what is causing this, probably just a glitch but we won't know unless SoundCloud would have people to actually support us, developers.