React Native: User Authentication Flow Explained

How to handle in-house authentication in React Native apps, with AsyncStorage

Ross Bulat
12 min readDec 10, 2019

With privacy concerns are at an all time high, consumers are moving away from OAuth based authentication, or authentication as a service — login with Facebook, Google, etc — in favour of the traditional authentication that cuts out the middlemen of authentication flow. From a developer standpoint, this comes with additional responsibilities in terms of both security and user experience.

This article will cover essential React Native APIs and external packages used to create an authentication flow in your app, keeping your authentication mechanisms in-house, and therefore private to external services, while maintaining security. We will cover APIs on both the React Native side and a Node JS server side, providing sample scripts along the way.

Prelude: Is OAuth demand falling?

In-house authentication has taken somewhat of a back seat in recent years, with many apps only opting for “Sign in with X” services based on the OAuth open standard, a protocol allowing services (often tech giants like Google and Facebook) to authenticate a user on an app’s behalf. There are benefits of doing this — less upkeep of your app in terms of data storage…

--

--

Ross Bulat

Programmer and Author. @ Parity Technologies, JKRB Investments