Authentication with Amplify

  1. Run the following command at the root of the application you cloned to add authentication to the application:
amplify add auth
  • Select follow the informations below:

    Do you want to use the default authentication and security configuration? Default configuration
    Warning: you will not be able to edit these selections.
    How do you want users to be able to sign in? Username
    Do you want to configure advanced settings? No, I am done.

CreateAuth

  1. Run the following command to update cloud resources:
amplify push

CreateAuth

  1. Navigate to the CloudFormation console to check if the stack has been created.
  • Click id of UserPool to open dashboard of Cognito User Pool

CreateAuth

  1. Run the following command to start the application: npm start
  • Click Sign up to register a new account.

Signup

  1. Enter user information:
  • Username, for example: admin
  • Enter your email.
  • Password, for example: Admin123
  • Click Sign up

Signup

  1. Navigate to Cognito User Pool console, selectUser tab you will see a registered but unconfirmed user

Signup

  1. Open your email to get the verification code that was sent automatically.

Signup

  1. Enter the verification code into the app and click Submit

Signup

  1. Navigate to Cognito User Pool console, click the Refresh icon and you will see that the user is confirmed

Signup

  1. Log in to the app with the account you just registered with.

Signin

  1. Successful login.

Signin

  1. Select My Profile on the left menu, then click Update profile

UpdateProfile

  1. Enter old password, new password to update password. Then click Update

UpdateProfile

  1. Click OK

UpdateProfile

  1. Click Sign out to log out

UpdateProfile

  1. Click Sign in to login again

UpdateProfile

  1. Enter your account information after updating to log in, then click Sign in

UpdateProfile

  1. You have successfully signed in with your new account.

UpdateProfile