Soundcloud OAuth2 API: getting invalid_scope error after user connection

I am trying to implement a Soundcloud connection and have a weird problem.

The first thing I do is send my users to

https://soundcloud.com/connect?client_id=MY_CLIENT_ID&redirect_uri=http://myredirecturl.example.com&state=RANDOM_STRING&display=page&response_type=code&scope=email 

When users connect, they are redirected to

 http://myredirecturl.example.com?error=invalid_scope&error_description=The+requested+scope+is+invalid%2C+unknown%2C+or+malformed.&state=RANDOM_STRING 

The same thing happens if I use scope=* .

However, if I use scope=non-expiring , it allows me to get through, but I need email for users, and there are not enough grants in this type of area.

I thought this was due to the fact that my application is in development mode, but Osman in Soundcloud said that it wasnโ€™t .

Thanks.

+4
source share
2 answers

The email area is not available for all integrations. It was used for several user integrations that provided us with acceptable terms of service / privacy policies. Unable to get user email address using SoundCloud API.

However, you can use the "*" area to get an access token. I will check with our application team to see why this gives you an error. I will edit my answer as soon as I have additional information.

For your purposes, I would stay with the โ€œnon-expiringโ€ area and simply ask the user to provide their email address (providing them with a way to agree on your terms of use / privacy).

+4
source

Using scope=* sometimes does not work because the URL is incorrectly encoded. If you get this error when using the * pattern, try encoding the URL correctly using a function like urlencode () (for PHP),

0
source

All Articles