OVERVIEW

OAuth2Flow is a static library and framework that facilitates the OAuth v2 authentication to services. It is available starting with iOS 7 and later and can be used in applications developed using Objective-C or Swift. 

MOTIVATION

The purpose of the library/framework is to provide an user friendly experience when authentication is done with Facebook, Twitter or any other service which provides OAuth v2 authentication. By using a view controller instead of Safari app you solve 2 problems:

  1. You remove the need to switch back and forth between Safari and your app.
  2. Because your app doesn't need to receive input from Safari, you don't need to handle possible security issues from interprocess communication.

THE VALUE OF OAUTH2Flow 

This OAuth2Flow offers a simple and transparent way of using OAuth v2 for authentication on APIs provided by various online services by implementing the whole handshaking mechanism in a secure way. The library also offers automatic refresh for the token, in case this is not a permanent one. 

OAuth2Flow is packaged as both static library and framework and offers backward compatibility from iOS 7.  The user experience is improved by providing the log-in inside the app. 

TECHNOLOGY

The library implements the typical OAuth v2 flow. From a newly created WebView, it sends a request to the Authorisation Server to present the login web page. After successful authentication the server will call back the URI along with the access token. The handler from the library will check for the token validity and in case of success, it will inform the delegate about the event. After this you can use the API without any need of authentication management.

You can find the complete source code and a demo project under our 3PillarLabs GitHub account: https://github.com/3pillarlabs/OAuth2Flow

We also created a short video that will show you step-by-step how to easily integrate the framework into your iOS application.