php-soundcloud icon indicating copy to clipboard operation
php-soundcloud copied to clipboard

authentication broken

Open teo1978 opened this issue 10 years ago • 2 comments

I follow the steps at https://developers.soundcloud.com/docs#authentication literally, but I systematically get a Services_Soundcloud_Invalid_Http_Response_Code_Exception when I call $client->accessToken() (after giving authorization and being redirected to the redirect url).

Additionally, even if I was doing something wrong (wichi is not the case unless the documentation is wrong, because I'm copying the code), the error message of the exception is definitely too generic and doesn't contain enough information to debug the issue

teo1978 avatar Apr 12 '15 18:04 teo1978

This is ridiculous. The error seems to be caused by calling the constructor without the third parameter (redirect_url). The redirect url parameter shouldn't be needed in this situation, and if it was, then an exception with a sensible error message should be thrown when calling the constructor, not when calling accessToken().

And after working this around, I've incurred into another bug.

teo1978 avatar Apr 12 '15 19:04 teo1978

The redirect_url is required, so really an exception should be raised before any request to the API is made. I'll add a clearer error message in this case.

glenscott avatar Apr 12 '15 20:04 glenscott