Add Auth / User Sign-in

Important

The following content applies if you are already using the AWS Mobile CLI to configure
your backend. If you are building a new mobile or web app, or you're adding cloud
capabilities to your existing app, use the new AWS Amplify CLI instead. With the new Amplify CLI, you can use all of the features described in Announcing the AWS Amplify CLI toolchain, including AWS CloudFormation functionality that provides additional workflows.

Set Up Your Backend

BEFORE YOU BEGIN

The steps on this page assume you have already completed the steps on Get Started.

The AWS Mobile CLI components for user authentication include a rich, configurable
UI for sign-up and sign-in.

To enable the Auth features

In the root folder of your app, run:

awsmobile user-signin enable
awsmobile push

Connect to Your Backend

The AWS Mobile CLI enables you to integrate ready-made sign-up/sign-in/sign-out UI
from the command line.

To add user auth UI to your app

Install AWS Amplify for React library.

npm install --save aws-amplify-react

Add the following import in App.js (or other file that runs upon app startup):