Search code examples
node.jsamazon-web-servicesauthenticationamazon-iamaws-sts

How to build a login using AWS IAM with javascript SDK?


need to use

  • AWS IAM
  • nodejs
  • AWS STS service

need to

  • register user
  • authenticate user
  • authorize user

and also need to know what are the best ways to do that using AWS services.is it better to use aws cognito?

expected- sample codes


Solution

  • We have this use case documented in the Photo Asset Manager (PAM) example app. In this example, the client is a REACT app that performs user authenication with Cognito. See this high level illustration:

    enter image description here

    Sample client app with a sign in button:

    enter image description here

    You can deploy the entire solution following the instructions located in the AWS Code Library topic here:

    Create a photo asset management application that lets users manage photos using labels

    See this Github location for the sample REACT client:

    https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/resources/clients/react/elros