Identity Lab 4 Exercise 1 - Adding Sign On

If you came to this page directly, go to the first page of this lab and read through the instructions before getting started.

In this lab, you will learn how to add sign-on capabilities to a Single-Page Application (SPA) and how to make this app consume an API that is secured with Auth0. You will integrate the SPA with Auth0 so that your users are able to use the Auth0 Universal Login Page to authenticate.

The SPA in question is a vanilla JavaScript application that consumes an API similar to the one you have used in previous labs (this API also exposes a secured endpoint that returns a list of expenses). The difference is that the API in this lab does two additional things:

  • The API supports CORS to enable the SPA to consume it from a different domain (or a different port in a local environment).

  • The API exposes a public endpoint that returns a summary of its database. The SPA consumes this endpoint on its homepage to share the summary publicly.

In this exercise, you will focus on integrating the SPA with Auth0 and getting the profile of the logged-in user. Exercise 2 will show how to consume the private endpoint exposed by the API.

video placeholder

video placeholder

video placeholder

video placeholder

video placeholder

Next →