With the systemXHR I believe you will still need to run an external server (what we do with communications app). One possible way might be to request the browser permission and listen for mozbrowserlocationchange.
This is what we're doing with the calendar application, I have no idea if it will work for your use case. Example: https://github.com/KevinGrandon/gaia/blob/master/apps/calendar/js/oauth_window.js#L112 Best, Kevin ----- Original Message ----- From: "Michael Bishop" <[email protected]> To: [email protected] Sent: Friday, June 28, 2013 7:08:21 AM Subject: Receiving an OAuth callback in a webapp? Hi All, I've been working on getting my web app to authenticate with Twitter using OAuth. I've been able to use systemXHR to retrieve temporary tokens and have also been able to open a new webpage in my app that shows twitter's login page. Now, after the user signs in, twitter wants to redirect that page to a callback url. 1. How do I make that callback url show my app? 2. How do I, within my app, retrieve the authentication token (which is a parameter that twitter appends to the callbackURL) On iOS, apps can register with a custom URL scheme that will launch them. Is there a similar facility on FirefoxOS. How do I intercept that url? Additionally, what exactly does the "origin" parameter in the manifest.webapp file enable? Any thoughts you have would be much appreciated. I'm very close to finishing and will gladly publish the source once it works. Thank you, _ michael --- Michael Bishop Hitpoint Studios http://www.hitpointstudios.com _______________________________________________ dev-webapps mailing list [email protected] https://lists.mozilla.org/listinfo/dev-webapps _______________________________________________ dev-webapps mailing list [email protected] https://lists.mozilla.org/listinfo/dev-webapps
