This is a walk through lab based on AWS project. For more details please refer here. This walk through breaks into four parts which are
In part 2, we will setup Amazon Cognito which provides user to register an account, send confirmation email with verification code and to do logins.
How it works:
What is Amazon Cognito:
Amazon Cognito provides two different mechanisms for authenticating users. You can use Cognito “User Pools” to add sign-up and sign-in functionality to your application or use Cognito “Identity Pools” to authenticate users through social identity providers such as Facebook, Twitter, or Amazon, with SAML identity solutions, or by using your own identity system.
In this part, we will be using User Pools, let’s go ahead and create one.
Give your Pool a name. You can choose “Review defaults” to finish the setup but I will step through settings for every steps.
The purpose of step through settings is to record all step details.
At this step, we need to add an app which will interact with Cognito.
And finally the last step to create User Pool.
Finish view. Copy “Pool Id” and “App Client Id” from App clients for later use.
Paste Pool Id, App Client Id and region into the code. We will input invokeUrl once API Gateway is done. Save config.js and replace the one we uploaded to S3 in part 1.
Choose the file we just modified and upload it.
File size is changed from 307B to 370B.
Enter your email and assign a password to it. Password must fulfill conditions set in Cognito. Once done, click LET’S RYDR!
If everything is configured correctly, you will be redirected to verify.html. Once you received the notification mail, key in the verification code. Check your spam mail box if you don’t see the mail.
Or you can verify the email manually from Cognito console as below.
Once account is verified, verify if the account can login.
If everything is configured correctly, you will see the image below.
And that’s it, Part 2 is done!