AWS Cognito and Web Applications – Protecting and Accessing APIs (JavaScript and .NET Core)

Introduction

A typical web application consists of a frontend (HTML, JavaScript, CSS), a backend (e.g. REST API) and database for persistence.

Frontend typically communicate over REST calls to the backend for services. Token based authentication is a very common way to manage authentication and authorization information back and forth in the web applications. Applications need to know who users are and what they can do.

In this post, we are going to see how to allow web applications running in user browser to securely communicate with backend APIs with the help of AWS Cognito user pool.

On high level, we will be covering following topics:

  • Integrate AWS Cognito User Pool and .NET Core Web API.
  • Testing API access using Postman REST client.
  • Integrating Web frontend (HTML, JavaScript, CSS) to make authenticated calls to .NET Core Backend API.

Now, some of pre-requisite work is already done and we will build whatever is remaining to have this demo ready.

Subscribe to continue reading

Subscribe to get access to the rest of this post and other subscriber-only content.