Connect With API Providers in App Using

OAuth is an open protocol to allow secure authorization from web, mobile, and desktop apps. However, making  OAuth work in your mobile app is not a simple task and often takes a lot of time and effort. Using the service is a great and simple way to save time, and make the authentication pretty much work out-of-the-box.

oauth-io-logo service can be easily integrated in app. There are two ways to setup the plug-in in app:

Include OAuth.js as JavaScript asset

This approach can be helpful when developing a mobile web app. Apps with OAuth.js included as JavaScript asset work from browser and can be quickly tested by clicking the Test button. Such approach saves development time because you don’t need to install the app on the device every time after making changes. These are the steps:

  1. Go to web site and download the latest JavaScript library.
  2. Upload this library to your app by choosing Create New -> JavaScript -> Create from file.
  3. You have to remove or comment the if statement on line 193 in that file because the app already contains some methods with “OAuth” name.

Include as PhoneGap plugin

Apps with service included as PhoneGap plugin will not work from the browser. Such apps should be built as binary and installed directly on the device. Steps for adding as PhoneGap plugin are almost identical to adding any 3rd party PhoneGap plug-in:

  1. Download repository from github plug-in page.
  2. Create new folder for this plugin in the app and upload oauth.js:
  3. Add the following line of code to the very beginning of this file:
    • cordova.define(“com.phonegap.plugins.oauthio”, function (require, exports, module) {
      and the closing bracket to end of file “}”.
    • Edit the cordova_plugins.js file by adding plug-in description.

Once the included in app the same code can be used to initialize and authenticate. See the documentation for code examples.


Adding service to your app is pretty simple.  See our detailed tutorial where we describe how to authenticate with Google and how to post to Facebook.