User Authentication with React Native & AWS using React Native Navigation (V2)

Nader Dabit
5 min readJul 26, 2018

Adding Authentication to a React Native app with React Native Navigation & AWS.

This is part 2 of a 2 part series. For part 1, click here.

Continuing on from Part1, we now want to add real user signup & signin to our app using AWS.

We’ll use AWS Amplify to connect to AWS, & Amazon Cognito to manage users.

If you already have the code from part 1, you can skip to the next step. If you are starting from here, you can clone the project from this repo and start from there.

Creating the Auth service

From within the root of the React Native project, we would like to initialize a new AWS project so that we can add authentication. To do so, we need to install & configure the AWS Mobile CLI:

npm i -g awsmobile-cli
awsmobile configure

Once you’ve installed & configured the CLI, initialize a new AWS project:

awsmobile init

This command will do a few things:

  1. Create a new Mobile Hub project in our AWS Account.
  2. Install a couple of dependencies into our project:aws-amplify & aws-amplify-react-native.
  3. Add local configuration files (awsmobilejs & aws-exports.js) that will allow us to edit configuration locally via the cli & push changes to our AWS Mobile Hub project in the AWS…

--

--

Nader Dabit
Nader Dabit

Written by Nader Dabit

Full Stack Product Engineer, Author, Teacher, Director of Developer Relations at Avara

Responses (10)