RedirectURI Issues with arbitrary GET parameters

48 views
Skip to first unread message

Max

unread,
Feb 25, 2012, 4:01:13 PM2/25/12
to SoundCloudAPI
I'm trying to maintain state across the authentication calls by adding
a query parameters into the callback URL. However, the API redirect
validation is so tight that it doesn't seem able to handle an
arbitrary query parameters. Am I missing something in the docs, or is
this just the way it is?

Thanks!

Paul Osman

unread,
Feb 28, 2012, 9:47:19 PM2/28/12
to soundc...@googlegroups.com
25 February, 2012 4:01 PM
Hi Max,

When you redirect the user to the authorization URL, append a 'state' param to the query string. So, for instance if the authorization URL was:

https://api.soundcloud.com/connect?scope=non-expiring&redirect_uri=http%3A%2F%2Fexample.com%2Fcallback&response_type=code&client_id=YOUR_CLIENT_ID

You'd redirect the user to the following:

https://api.soundcloud.com/connect?scope=non-expiring&redirect_uri=http%3A%2F%2Fexample.com%2Fcallback&response_type=code&client_id=YOUR_CLIENT_ID&state=foo

Anything in the state variable will then be appended to the querystring when the user is sent to your callback URL.

Hope that helps, lemme know if you have any questions.

Cheers,

Paul

--
Paul Osman
Developer Evangelist
http://twitter.com/paulosman
Skype: paulosman

SoundCloud HQ USA
San Francisco CA, 94110
Reply all
Reply to author
Forward
0 new messages