Angular User Auth using Auth0, Firebase, & AWS Lambda

Author: Rich Tillis

Published on July 9, 2021

Last Revised on July 9, 2021

This series of posts describes one way to add user authentication to an Angular application using Auth0 and Firebase with the help of AWS Lambda.

Overall Takeaways

This guide shows one way to integrate Auth0, AWS Lambda, and Google Firebase together into the authentication of an Angular app. It is not a complete, polished, production-ready authentication solution, however you will learn a way to:

  • Integrate Auth0 into an Angular App
  • Create a route in API Gateway and secure it with a JWT
  • Store (encrypt) and retrieve (decrypt) a Firebase Admin key in the AWS Parameter Store
  • Mint a Firebase auth token in an AWS Lambda
  • Authenticate into Firebase using a custom minted token

Prerequisites

  • Auth0 Account - You can sign up here.
  • Firebase Account - You can sign up [here][5].
  • Amazon AWS Account - Information about how to sign up can be found [here][3]. The sign up process is more involved than either Auth0 or Firebase. It does require a credit card which, if you are like me, left me feeling a little uneasy that I might mess something up and run up a huge AWS bill. You are not alone. There are [ways][4] to setup billing alarms to warn you when you exceed a threshold you specify. This tutorial will stay well within the AWS free-tier.
  • Asynchronous programming, JavaScript Promises, RxJS Observables and Observers are used throughout this tutorial. Familiarity with these objects and concepts will help you understand how component data is being managed.

Guide Overview

  • Part 1 - Setup of the Angular App and setup & integrate Auth0 into it.
  • Part 2 - Setup & integration of Firebase into the App.
  • Part 3 - (Coming Soon!) Setup of AWS API Gateway & Lambda to use by the app.