User Authentication using Angular, Amplify, and AWS Cognito Hosted UI — Part 1

Chameera Dulanga
Enlear Academy
Published in
5 min readJan 29, 2020

Usage of AWS cloud services in web and mobile solutions have been rapidly growing in the recent past. Today, I will explain how we can develop a user authentication system for an Angular application using AWS Cognito Hosted UI and Amplify library in no time.

Step 1 — Creating a new Angular application.

First of all, you have to create a new angular application to test the authentication. For that, we can simply use commands provided in the Angular guide.

Enter the following commands in the terminal to create a new Angular app.

npm install -g @angular/cli

ng new my-app

Then you can go inside the my-app folder and run ng serve to check whether your app is working.

Step 2 — Installing Amplify CLI

Then we need to install Amplify CLI and configure it with the AWS account.

npm install -g @aws-amplify/cli

amplify configure

You will automatically be redirected to the AWS login window. After login with your credentials, go back to the terminal and press Enter to continue configuration. Then you will have to select a…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in Enlear Academy

We provide high quality content on web development and cloud technologies for developers.

Written by Chameera Dulanga

Associate Technical Lead | AWS Community Builder (x4) | Content Manager

Responses (2)

What are your thoughts?

Where is part 2? This application is nowhere near complete or usable if one has to enter the URL for the hosted UI manually. All you have done is added an unnecessary extra interface to AWS Cognito.

--

Thank you for this sample that works for me when I redirect to localhost but how we can deploy and redirect to an application deployed on s3 bucket ? Thx

--