Edrica Carpena
Edrica Carpena

Reputation: 33

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.

Upvotes: 3

Views: 300

Answers (2)

Sampaguita
Sampaguita

Reputation: 96

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.

Upvotes: 0

Alex Hellier
Alex Hellier

Reputation: 485

I am also getting a similar issue with 401 (started approx 20th March)

It was failing from work, and the api.soundcloud.com was resolving to a set of IP's

Trying from home, and the code would work.

This has not stopped, and my DNS is now resolving to a similar IP set as my work address.

Definitely seems to be a soundcloud issue as they are changing DNS / settings etc

To update this with some data:

  1. This was from my home network, when it was working:
 nslookup api.soundcloud.com
Server:     172.64.36.1
Address:    172.64.36.1#53

Non-authoritative answer:
api.soundcloud.com  canonical name = d3ad8414wy4gwn.cloudfront.net.
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 99.86.107.49
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 99.86.107.53
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 99.86.107.62
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 99.86.107.50

This was from my work address (not working) sadly I did not have nslookup installed on the server to check with

ping api.soundcloud.com
PING d3ad8414wy4gwn.cloudfront.net (13.224.236.51) 56(84) bytes of data.
64 bytes from server-13-224-236-51.lhr62.r.cloudfront.net (13.224.236.51): icmp_seq=1 ttl=245 time=10.9 ms
64 bytes from server-13-224-236-51.lhr62.r.cloudfront.net (13.224.236.51): icmp_seq=2 ttl=245 time=13.9 ms
64 bytes from server-13-224-236-51.lhr62.r.cloudfront.net (13.224.236.51): icmp_seq=3 ttl=245 time=8.43 ms
64 bytes from server-13-224-236-51.lhr62.r.cloudfront.net (13.224.236.51): icmp_seq=4 ttl=245 time=13.2 ms

And now my new data from home (now also failing)

nslookup api.soundcloud.com
Server:     172.64.36.1
Address:    172.64.36.1#53

Non-authoritative answer:
api.soundcloud.com  canonical name = d3ad8414wy4gwn.cloudfront.net.
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 13.35.195.35
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 13.35.195.39
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 13.35.195.65
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 13.35.195.60

Update 02/04/2020

Home: Working Office: Failing

Home

nslookup api.soundcloud.com
Server:     172.64.36.1
Address:    172.64.36.1#53

Non-authoritative answer:
api.soundcloud.com  canonical name = d3ad8414wy4gwn.cloudfront.net.
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 52.85.71.53
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 52.85.71.56
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 52.85.71.47
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 52.85.71.46

Work:

nslookup api.soundcloud.com
Server:     127.0.0.53
Address:    127.0.0.53#53

Non-authoritative answer:
api.soundcloud.com  canonical name = d3ad8414wy4gwn.cloudfront.net.
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 143.204.188.51
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 143.204.188.52
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 143.204.188.56
Name:   d3ad8414wy4gwn.cloudfront.net
Address: 143.204.188.60

Upvotes: 0

Related Questions