How to use Auth0 Integration for Visitor Authentication

This page describes how to use the Auth0 integration to publish your space behind Visitor Authentication

Setting up Auth0

First, sign in to Auth0 platform and create a new application (or use an existing one) by clicking the Applications button in the left sidebar. If creating a new application, name it appropriately and choose "Regular Web Application" as the option. Click Create. You may need to be admin to follow along this guide.

A quickstart panel will show up. Select Node.js (Express) option and then select "I want to integrate my app." You will see a screen prompting you to configure Auth0. It should look like the image below

Click on Save Settings And Continue.

Click on Settings next to Quickstart, and make a note of the Domain, Client ID, and Client Secret. We will need these to configure our Auth0 Visitor Authentication Integration.

Installing the Auth0 Visitor Authentication Integration

Navigate to the Integrations tab in a space and locate the VA-Auth0 integration or navigate directly to this https://app.gitbook.com/integrations/VA-Auth0.

Install the integration on your organization (if necessary) and then install it on your desired space.

Upon installation on space, you will see a screen asking you enter the Client ID, Auth0 Domain, and Client Secret.

For Client ID and Client Secret, paste in the value you copied from Auth0 Dashboard. For Auth0 Domain, enter the Domain copied from Auth0 (make sure to prefix it with https://) .

Click Save.

Copy the URL displayed in the modal and enter it as an Allowed Callback URL in Auth0 (as shown in the second screenshot in this guide). Hit Save

Now, in GitBook, close the integrations modal and open the Share modal (top right of the screen) and click "Share to an audience", and enable the "Publish with Visitor Authentication" toggle. Choose the VA-Auth0 integration as your backend for Visitor Authentication, hit Save, and you're done! The space is now published behind Visitor Authentication controlled by your Auth0 application. To try it out, copy the link where the space is published (you can get this from the Share modal, under "Share to an audience") and open the link in a new tab. You will be asked to sign in with Auth0, which confirms that your space is published behind Visitor Authentication using Auth0.

Last updated