Implementing sign up, sign in, and sign out over and over again is not very lean. Implementing this logic in a single-page application is also not desirable. In this recipe, we will see how to implement the OpenID Connect Implicit Flow in a single-page application to authenticate users with the AWS Cognito Hosted UI.
Implementing sign up, sign in, and sign out
How to do it...
- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch5/cognito-signin --path cncb-cognito-signin
- Navigate to the cncb-cognito-signin directory with cd cncb-cognito-signin.
- Review the file named src/App.js with the following content and update the clientId and...