OAuth 2 Template: Plug-in for OAuth Authentication by Appery.io
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.
By the way, have you ever tried to build an app with our app builder? You’ll be amazed how easy and fast it is to build Android, iOS and Windows Phone apps with Appery.io. Less words, more action- so try it yourself!
Here is the basic flow implemented in this plugin:
- 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.
- Once the “Sign in” button is clicked, the app will navigate to the defined (in OAuth_Settings) OAuth provider.
- Here, the user should sign in (if not signed in yet) and grant access to the app that requests permissions.
- Once the access in granted, the app will navigate back to the Details page and with the access_token parameter added to the URL.
- 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.