Welcome!

APIs for the Internet of Things

Max Katz

Subscribe to Max Katz: eMailAlertsEmail Alerts
Get Max Katz via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Blog Feed Post

OAuth 2 Plugin to Simplify Mobile Development in Appery.io

Screen Shot 2015-02-24 at 3.53.50 PM

OAuth 2.0 protocol is now the most popular authentication protocol for apps. By using OAuth protocol, you can securely authenticate with a variety of popular services what will increase app functionality and cover a much larger target audience.

The Appery.io App Builder has a large number of useful and convenient mobile development tools for rapidly creating Android, iOS and Windows Phone apps. Today we are glad to present another feature that significantly helps with the OAuth 2.0 authentication routine – the OAuth 2 Template plugin.

A new plugin is a set of parameters, services, JavaScript code and logic that matches the OAuth 2.0 flow. All you need to do is configure this plugin for your needs by adding certain API keys and URLs. We tried to simplify the OAuth setup in your mobile app as much as possible: making difficult things easy – that’s the main benefit of Appery.io.

Here is the basic flow implemented in this plugin:

  1. Once the app is launched, there is a “Sign in” button on the Home page. There is also JavaScript code that initiates the OAuth flow attached to the “Sign in” button.
  2. Once the “Sign in” button is clicked, the app will navigate to the defined (in OAuth_Settings) OAuth provider.
  3. Here, the user should sign in (if not signed in yet) and grant access to the app that requests permissions.
  4. Once the access in granted, the app will navigate back to the Details page and with the access_token parameter added to the URL.
  5. The next request will get the signed in user profile details. This means that any API call can be made with the obtained access token.

These five steps will be processed in the background, so all the user needs to do is click “Sign in” and grant an access to your app.

We prepared a step-by-step tutorial that shows how to add this plugin to your app and how to configure it with examples using Google authentication.

We tried to make this plugin as generic as possible that will work with as many OAuth 2 providers as possible. But, there is always a chance that OAuth flow and setup might be slightly different among various provides. It’s still important you read their docs and understand how their particular flow works.

Here at Appery.io, we always try to create the best solutions and simplify app development, so your feedback is extremely important to us – it’s how we gather information about how we can improve and update the builder in the future. Share your thoughts with us here, via email or on the forum and follow us on Twitter.

Originally posted on the Appery.io blog


Read the original blog entry...

More Stories By Max Katz

Max Katz heads Developer Relations for Appery.io, a cloud-based mobile app platform. He loves trying out new and cool REST APIs in mobile apps. Max is the author of two books “Practical RichFaces” (Apress 2008, 2011), DZone MVB (Most Valuable Blogger), and is a frequent speaker at developer conferences. You can find out what Max is up to on his blog: http://maxkatz.org and Twitter: @maxkatz.