06-17-2012 12:37 AM
I am developing a Soundcloud application, which utilizes oAuth2 as its authentication service. It works by opening a webpage with login fields, and then if the user's credentials are correct, it proceeds to a specified redirect_uri. This is a url that takes the user back into the application. Android and iOS devices utilize something called a protocol scheme, which is a handle back into the apps. For example, 'myApp://parameter' which would be used as a url to navigate back into the app.
Is there any such url availble to use with AIR on the tablet sdk? If not, how should I go about this? The user must be authenticated.
Here are the soundcloud docs...
Solved! Go to Solution.
06-17-2012 04:24 AM - edited 06-17-2012 04:25 AM
The easiest way is to use an embedded browser (e.g. StageWebView) for the authorization, and listening for navigation events. If the navigation destination URL is your redirect URL, then the OAuth flow is done and you can grab your token from the URL parameters, cancel the navigation and remove the browser.
06-17-2012 02:11 PM
Well I have been using StageWebView to open up the login page, and have been using navigation event listeners to trigger on changes, all just as you described.
However, how exactly would I go about getting the parameter from the url?
Thanks for reply!
06-17-2012 02:18 PM
06-18-2012 01:18 PM
Yeah like I said, its never triggering that event listener, because the location never changes, at least looking in from the outside. Somehow its all done within some frame or something in the page.