Souncloud error_limit error while receiving authentication token

My application just stopped receiving authentication tokens from soundcloud. I use php api and send the request as:

$client = new Services_Soundcloud(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL); $code = $_GET['code']; $access_token = $client->accessToken($code); 

He returns me the following answer in the morning:

 {"errors":[{"meta":{"rate_limit":{"bucket":"by-ip","max_nr_of_requests":100,"time_window":"PT1H","group":"oauth2_token"},"remaining_requests":0,"reset_time":"2015/08/13 12:03:38 +0000"}}]} 

Until the last night, it worked perfectly with the same code.

+5
source share
1 answer

SoundCloud, in its infinite wisdom, chose to deploy a speed limit on the endpoint / oauth 2 / token. They only allow 100 requests / hour from the same IP address. This causes serious problems for applications that use the server-side authentication flow, since all requests to the / oauth 2 / token endpoint for this application are taken from the server, which causes it to reach the speed limit as soon as the application has more than 100 person try to authenticate within an hour.

I managed to get around this problem by switching to a client-side authentication flow using the SoundCloud Javascript SDK . This ensures that your users ’browsers make / oauth 2 / token requests and not your servers, thereby avoiding speed limits.

This is all that I learned when I dealt with the problem myself. SoundCloud did not actually publish any documents for this new tariff limit. It seems that they are becoming less and less friendly for developers, so I will be afraid that in the future I will be sure of the stability of their API.

+1
source

All Articles