Skip to content
API Reference

Connect Auth0

Connect Auth0 as an identity provider for zone-level user authentication.

This is the Auth0 walkthrough for Authenticate users with your identity provider. We will start by creating an application in your Auth0 tenant. We will then configure Auth0 as a provider in your Keycard zone. This application and provider pair creates a connection that will allow users to sign in using Auth0.

For illustrative purposes, the zone in this tutorial is named “Example”. Each zone also has a unique Zone ID that appears in the zone’s domain: <zone-id>.keycard.cloud. The Zone ID is distinct from the zone’s name. Throughout this tutorial, <zone-id> is a placeholder you will replace with the ID of your own zone.

In the first phase of this tutorial, we will create an application in Auth0. You’ll configure the application with the necessary settings to connect it to your zone.

  1. In Auth0 Dashboard, select Applications > Applications in the navigation menu.

  2. On the Applications page, click the Create Application button. A Create application wizard will appear.

    In the Name field, enter “Example”, which is the name of your zone.

    Choose Regular Web Application as the application type.

    Click the Create button. You will be directed to a page to set up the newly created Example application.

  3. On the Example application page, click the Settings tab.

    Notice that the Quickstart tab was originally selected, prompting you for information about what framework you are using to build your project. Keycard connects to Auth0 over standard OpenID Connect, so you can skip the Quickstart tab.

    In the Settings tab, scroll down to Application URIs.

    In the Allowed Callback URLs field, enter https://<zone-id>.keycard.cloud/oauth/2/redirect.

    Optionally, in the Allowed Logout URLs field, enter https://<zone-id>.keycard.cloud/openid/connect/redirect/logout. Keycard uses it only for single logout, which is off unless you turn it on for the Provider through the Management API.

    Double check that the domain in the URLs matches the domain of your zone.

    Click the Save button.

    Open the Credentials tab and set Authentication Method to Client Secret (Post), which is how Keycard sends the secret. Save the change.

You’ve successfully created an application in Auth0. You should now be on the settings page for the new Example application. This application will allow users in your Auth0 tenant to sign into your zone.

Remain on this page, as we will need to refer to the settings in the next phase.

In the next phase of this tutorial, we will create a provider in Keycard. You’ll configure the provider with the necessary credentials to connect to your Auth0 tenant.

It is recommended that you complete these steps in a new browser tab or window, as you’ll need to copy and paste settings between Auth0 Dashboard and Keycard Console.

  1. In Keycard Console, make sure you’re in your Zone, because Keycard creates the Provider in the Zone you’re in and your Zone can only use its own Providers for sign-in. If you aren’t in it, go to Zones, open the ⋯ menu on your Zone’s card, and select Switch to zone.

    Creating a Provider takes the Manager Role on the Zone. If Switch to zone is missing from the card’s menu and you aren’t already in that Zone, you don’t have access to it yet; see Assign Zone Admin Access.

  2. Select Providers in the navigation menu.

  3. On the Providers page, click the Add Provider button. A Create provider screen will appear.

    In the Name field, enter “Auth0”.

    In the Issuer URL field, enter your Auth0 domain, prefixed with https:// as the URL scheme and suffixed with a trailing /. For example: https://<your-tenant>.auth0.com/.

    Your Auth0 domain can be found on the application settings page in the Domain field in Auth0 Dashboard. It is easiest to copy and paste the value from Auth0 Dashboard to Keycard Console.

    In the Client ID field, enter the Client ID that Auth0 assigned to the newly created Example application. This can be found in the Client ID field on the settings page for the application in Auth0 Dashboard. It is easiest to copy and paste the Client ID from Auth0 Dashboard to Keycard Console.

    In the Client Secret field, enter the Client Secret that Auth0 generated for the Example application. This can be found on the same settings page. It is easiest to copy and paste the secret from Auth0 Dashboard to Keycard Console.

  4. Click Create Provider. Keycard Console opens the new Provider’s Configuration tab.

You’ve just created a Provider in Keycard that is connected to your Auth0 tenant!

In the final phase of this tutorial, we will configure user authentication to occur through Auth0.

  1. In Keycard Console, still in your Zone, click Settings under Zone in the sidebar.

  2. On the zone configuration page, select the Settings tab.

  3. In the Zone sign in configuration section, open the Identity Provider dropdown and select Auth0.

  4. Click Save Changes.

You have just configured your zone to authenticate users through Auth0! Now, whenever a user of your service attempts to access an application or resource protected by Keycard, they’ll sign in via Auth0.