Developer Centre
Best Practices for OAuth with Fire Eagle
|
Fire Eagle supports multiple methods of OAuth authentication that we tentatively name ‘web’, ‘desktop’, ‘mobile’ and ‘plugin’. However, the power of modern development tools rather blurs those definitions. Techniques that naturally apply to ‘desktop’ environments can now be applied to mobile devices, so there are some new tricks that can really smooth out the authentication experience for your users. This article was written mostly to address our recommended method of authenticating from Apple’s iPhone platform, but the technique applies equally to other devices, and we've tried to cover the major ones. We're trying to ensure that users are only exposed to the safest way to disclose their location using OAuth. To do this, it's critical that a fundamental principal of browser-based authentication is followed; that the contexts of the third party application and the web service authentication remain separate. To allow users to grant trust to an application, they must perform the OAuth action within their web browser, not within the applications themselves. Otherwise, there is no way to verify the identity and authenticity of any page which asks for their username and password. Users must not ever enter their username and password into a third party application when a browser-based authentication API like OAuth is available.
Operating Systems with limited multi-processing capabilities (such as the iPhone) can use this technique to smoothly bridge the gap between their application and the authentication and authorisation processes. More capable operating systems that maintain applications in the background can use this technique to smooth out and remove the ‘Click OK to continue’ step common in browser-based authentication in the past. A very important ‘do not’A powerful feature of many software platforms (including iPhone OS), is to embed a web rendering control directly into an application. WebKit, Trident or Gecko powered controls allows HTML, CSS and JavaScript to be rendered right inside the app, and allows remote pages to be displayed, similar to the behaviour of a web browser. This is a really useful tool for many purposes, but we insist that you must not use embedded rendering controls to present the OAuth process with Yahoo! and Fire Eagle. Whilst the intention is to provide a slick authentication experience, masking the Yahoo! and Fire Eagle authentication screens inside an embedded control breaks the trust contexts that OAuth encourages, and exposes our users a huge risk of phishing. Because the log-in pages are embedded, the user has no way to confirm that the page you’ve directed them to is genuine; there’s no padlock confirmation for secure HTTPS connections, and no URL bar to inspect the domain. Users are being encouraged to check for these cues as part of their routine, and being discouraged from ever entering their passwords directly into a third party application (be it in their web browser, or in standalone applications). This is to help them stay safe on the internet. Keeping auth steps inside the browser is vital for that effort to progress. The browser is an environment that the user trusts, and an environment where that trust can be verified — URL bar, SSL indicators, anti-phishing tools and so forth. A third party application is not, and is an environment of more limited trust. As such, a user should only ever enter their web service passwords into their most trusted environment; the browser. In short, this behaviour makes it possible for an application to fake the Yahoo! login page, with no way for the user to verify. Usernames and passwords could be stolen and in the case of Yahoo, that risk extends far beyond Fire Eagle; the user’s email, address book, IM, and more could all be compromised. Remaining within a single application is a small benefit massively outweighed by the devastating cost of a successful phishing scam. We’re pushing for our users to become familiar using browser-based auth within the browser only, and we will reject applications which ask for user passwords directly. How to Auth RightFollowing are basic instructions on how to add custom URL handlers into your application, so that you can authenticate through the web browser, without your user manually switching between applications. Register a custom URL handlerOperating systems allow applications to register handlers for new URL schemes. So, just as Firefox registers itself as the handler for official protocols like To maintain the trust contexts of OAuth, your application needs to register a URL handler for your own custom protocol. It’s worth using a structured name, such as one derived from your product URL, to protect against collisions with other apps. e.g. In OSX – both Mac OSX and iPhone OS — you can create custom URL schemes in the
Twitterific developer Craig Hockenberry has released sample code showing how to use URL schemes for inter-application communication on iPhone OS. On Microsoft Windows, protocol handlers are recorded in the Registry, under
Linux is fragmented into two separate desktop environments which have separate methods of registering URL handlers:
The Skype forums also contain instructions for configuring URL handlers in KDE, Gnome and Firefox: Making Skype links work. If you have examples achieving this technique on other platforms, or fuller examples then we'd love to include them here. Please get in touch through the Fire Eagle mailing list group. Pass the
|

