Authenticate Catalyst Apps with Auth0

Introduction

In this tutorial, we will be integrating Auth0’s Single Page Application (SPA) authentication service with applications created or hosted on Catalyst. This integration employs industry standard OpenID Connect and OAuth 2.0 authentication protocols making it possible to add end-users to Catalyst applications using third-party authentication services.

Auth0, much like Catalyst Authentication, is a cloud-based identity and access management platform that offers developers to add end-users to your application through Social Logins, multi-factor authentication, and more.

The client of your application will be rendered in the following manner: catalyst_tutorials_third_party_app_deployed

The logic of this application is coded by employing the following Catalyst services and its respective components:

You will be using the Catalyst web console and the Catalyst Command Line Interface (CLI) to build this application.

Note: You will be given the code for the files to be included in the function and client components in this tutorial. You will just need to copy the provided code and paste it into the appropriate files as directed.

Application Workflow

The workflow of how an end-user is authenticated using Auth0 and added as a user to your Catalyst application is detailed below:

  1. The end-user will be provided the option to log in to the application.
  2. Once the user attempts to log in, they will be directed to the login elements generated by the Auth0 service. Here, the end-user will be provided the option to Signup or Sign using Google social login, or by providing their user information such as their name, email address.
  3. Once the end-user is authenticated by the Auth0 service, the details will be forwarded to the client with an authorization code.
  4. he authentication logic in the backend function will be triggered and an API call will be made to the Auth0 service using the authorization code.
  5. Using this API call, the required user details will be passed to Catalyst, and a Catalyst custom token will be generated.
Info: The code to generate custom server token is also available in this help section and in the Catalyst console.
  1. Now, the user details will be made available in the client and in the User Management section of the Catalyst Authentication component. The end-users’ details along with the token information will also be stored in the browser cookie through the Web SDK, to ensure the session is maintained.
  2. The user will now access your application through its endpoints. The Catalyst Security Engine ensures that all the components associated with the application are accessed securely by end-users.
Info: The token will only remain valid for one hour. After that, the steps from 5 to 7 will be repeated in the background.

Once the end-user is authenticated and the login session continues to persist, they can securely access all the end points of your application until the token’s expiration time.

Last Updated 2026-02-23 22:17:04 +0530 IST

Min Time to Complete:

40 mins

Difficulty Level:

Intermediate

SERVICES INVOLVED

CloudScale Serverless

COMPONENTS INVOLVED

Authentication Data Store ZCQL AppSail