Table of Contents

About

The sign-in state

After users have a confirmed account, they will be able to sign in:

  • They gives their username (or email) and password.
  • On internet,:
    • a JavaScript function then communicates with Amazon Cognito, authenticates using the Secure Remote Password protocol (SRP), and receives back a set of JSON Web Tokens (JWT).
    • The JWTs contain claims about the identity of the user
    • The JWT is used to authenticate against the RESTful API (build with Amazon API Gateway)

Implementation

Aws provides several implementation, one by library.

Amplify is the reference one.

Amplify

A sign-in with the the javascript amplify sdk after installation and configuration

import Auth from '@aws-amplify/auth';

Auth.signIn(username, password)
  .then(success => console.log('successful sign in'))
  .catch(err => console.log(err));

Js Identity

See sign-in

Js Auth

The javascript auth library, see sign-in

The sign in form uses the cognito sign-in javascript.

Cognito Js Auth Sign In

Redirect

For Sign in Redirect URI(s) inputs, you can put one URI for local development and one for production. Example: http://localhost:3000/ in dev and https://www.example.com/ in production.