Manage Users
In this module you’ll create an Amazon Cognito user pool to manage your users' accounts.
Prerequisites
An email verified with Amazon SES is needed to complete this section.
Follow these steps:
Creating an email address identity
Create and integrate with a User Pool
Navigate to the Amazon Cognito console and click Create user pool
In the Cognito user pool sign-in options
section, select User name
and click Next
Select Password policy mode as Cognito defaults
. Choose No MFA
and click Next
On the Configure sign-up experience
page, keep all defaults and click Next
On the Configure message delivery
page, select Send email with Amazon SES
.
In the FROm email address
field select the email you created and verified in the prerequisites.
On the Integrate your app
page, name the user pool as WildRydes
and the App client name
as WildRydesWebApp
. Click Next
Click Create user pool
Copy the User Pool ID
in the User pool overview
section and save it in a secure location on your local machine.
Select the App Integration
tab and copy and save the Client ID
in the App clients and analytics
section of your newly created user pool.
Update the website config file
Open the wildryde-site/js/config.js
file
Update the values for userPoolID
, userPoolClientId
and region
.
git add js/config.js
git commit -m "Added cognito configuration"
git push
A deployment will be triggered in CodeCommit.
Validate the implementation
Open the site from the Amplify URL and click on GIDDY UP!
Use a fake email for testing purposes and click LET’S RYDE
As it is a fake email address, we will confirm the user manually through the Cognito console.
In the Amazon Cognito console, select the WildRydes
user pool.
In the Users
tab, the user with the dummy email address will be shown. View the details of this user.
IN the Actions
dropdown, select Confirm account
. In the pop-up choose Confirm
.
Visit the SIGN IN
page, by accessing the /signin.html
page
https://master.d1jbkv7wln16xu.amplifyapp.com/signin.html
After successful authentication, you should be redirected to /ride.html
.
You should see the Successfully Authenticated!
message.
Copy the auth token displayed, as it will be needed in the configuration of the API Gateway
.