Use Auth0 for sign in
Tutorial on using Auth0 for user authentication.
In this tutorial, we will configure user authentication to occur through Auth0. 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” and is
available at the domain example.keycard.cloud.
Create application in Auth0
Section titled “Create application in Auth0”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.
-
In Auth0 Dashboard, select Applications > Applications in the navigation menu.
-
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.
-
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 has pre-built features to integrate with Auth0, so this can be skipped.
In the Settings tab, scroll down to Application URIs.
In the Allowed Callback URLs field, and enter:
https://example.keycard.cloud/oauth/2/redirectIn the Allowed Logout URLs field, enter
https://example.keycard.cloud/openid/connect/redirect/logout.Double check that the domain in the URLs matches the domain of your zone.
Click the Save button.
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.
Create provider in Keycard
Section titled “Create provider in Keycard”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.
-
In Keycard Console, select Providers in the navigation menu.
-
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://example.us.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.
You’ve just create a provider in Keycard that is connected to your Auth0 tenant!
Use Auth0 for sign in
Section titled “Use Auth0 for sign in”In the final phase of this tutorial, we will configure user authentication to occur through Auth0.
-
In Keycard Console, select Zone Settings in the navigation menu.
-
On the Zone settings page, scroll down to the Zone sign in configuration settings.
Toggle Use an external Identity Provider to on. In the Identity Providers drop-down list, select “Auth0”.
Click the Save Changes button.
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.