3 Ways to Save Important Data in Monaca Apps

Image for post
Image for post

Building secure applications is a challenge you might face while developing Monaca applications. Important data, such as payment information or personal files, are potentially dangerous if they fall into the wrong hands. Today, we are introducing 3 ways to ensure the security of your applications’ data.

Contents

  1. Using KeychainPlugin
  2. Using Server-Side
  3. Using Secure Storage

Using KeychainPlugin

KeychainPlugin provides native iOS secure storage for your data. The downside of this is that this option is limited to iOS applications.

First, install KeychainPlugin in Monaca. (require Gold Plan with Monaca)

Image for post
Image for post

After the installation finishes, fill out necessary configurations in both iOS App Setting and Build Setting. The build has to be done as an iOS application instead of using Monaca Debugger. Note that you will be asked to provide your Developer Certificate in the Build Setting.

Image for post
Image for post

Also, provisioning registration is required when you build your application so create your provisioning profile in advance.

Image for post
Image for post

Below you can find the snapshots of a demo application with KeychainPlugin.

Successfully stored data using Keychain.

Image for post
Image for post

If the key does not exist, null is returned. If the key does exist, the data can be retrieved.

Image for post
Image for post

Now we can store important data, such as user tokens or user IDs, securely with the KeychainPlugin.

Using Server-Side

Another way is to return the data that are stored on the server side to the application. In this case, you will use authentication (such as OAuth2) to establish a connection to the server side. Once the connection is established, the server side can return the required data to the application. One advantage is that, even if some problem happens, you only need to handle the server-side (e.g. refreshing tokens). As a trade off, this method requires an Internet connection during the process.

Using Secure Storage

Monaca Enterprise plan offers Secure Storage. Secure storage can provide reliable data access data for you applications. It is provided by encrypting saved data on devices, preventing information leaks in the case of theft or loss.

Monaca Enterprise — Accelerate Your Mobile Strategy with Monaca Enterprise

Conclusion

Ensuring data security involves numerous steps and it’s difficult. We could have stored user’s log every time they open the app, but it’s certainly a disadvantage for the user experience. We should always keep in mind the importance of the data we are handling and apply proper security options for those data.

The Web Tub

Pushing the web current through hybrid mobile and PWA…

Onsen UI & Monaca Team

Written by

Team of developers from Onsen UI and Monaca

The Web Tub

Pushing the web current through hybrid mobile and PWA technology. Presented by the Monaca and Onsen UI team.

Onsen UI & Monaca Team

Written by

Team of developers from Onsen UI and Monaca

The Web Tub

Pushing the web current through hybrid mobile and PWA technology. Presented by the Monaca and Onsen UI team.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store