Introducing PassportKit Swift Package and CocoapodBlog

During our research and development programme, we’ve been doing a lot of work to streamline the development process for apps by cutting down on work needed for standard processes that are part of most, if not all, apps.

PassportKit addresses the login process, every API we develop here at Appoly makes use of OAuth 2.0, as it the industry-standard authentication protocol used in the majority of modern-day web applications. 

Passport kit streamlines the process of setting up a flow in your app to communicate with OAuth 2.0 servers. The library makes requests to your server and keeps a record of your authentication token securely stored on your device for further use throughout your app.

Technical Challenges

It’s always a challenge to make sure a package does what you want it to do but is generic enough to work in almost every scenario. When taking this into consideration the main concern, with regards to the PassportKit library, was securely storing the user’s authentication token on the device.

In order to securely store the user’s authentication token, we opted to make use of the iOS Keychain to securely retain the necessary data on the device. We opted this solution for two primary reasons; it’s simplicity and it’s proven track record. Using keychain, rather than any other form of secure storage, allows us to store our authentication token using a developer-defined keychain identifier, and that’s all that is needed!

Keychain also allows us to retain this data outside of the app lifecycle, meaning that if the user uninstalled the app, but decided to reinstall it later they can.

There are always improvements to be made so make PassportKit one of your dependencies today, we’d love your feedback!

You can install PassportKit using Swift Package Manager or Cocoapods, the instructions can be found on the GitHub page.

https://github.com/appoly/PassportKit