Install and configure Auth0

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.

NOTE: The steps below assume that you have an Auth0 account. If not, register for a free Auth0 account.

First, create a new Auth0 application as follows:

  • Log in to the Auth0 website and navigate to the “Clients” menu. Click the “Create client” button and choose “Regular Web Application” as the client type.

    Create client

  • Browse to the “Settings” tab for the application in the Auth0 dashboard and note the domain, client ID and client secret.

    Client credentials

  • In the same “Settings” tab, update the “Allowed Callback URLs” field and set it to the value http://DRUPAL_SITE_ADDRESS/auth0/callback. Replace the DRUPAL_SITE_ADDRESS placeholder with the actual IP address of your Drupal host. Save the changes.

    Client callback

Next, install and configure the Auth0 module in your Drupal host as follows:

  • Log in to the server console, change to the application directory. Depending on your installation type, run the following commands:

    • Approach A (Bitnami installations using system packages):

        $ cd installdir/drupal/
    • Approach B (Self-contained Bitnami installations):

        $ cd installdir/apps/drupal/htdocs/
  • Update Composer:

      $ sudo composer self-update
  • Install the Auth0 module and its dependencies with Composer:

      $ composer require auth0/auth0_drupal:^2.0.0
  • Log in to the Drupal administration panel as an administrator.

  • From the “Extend” menu, select the Auth0 plugin, which should appear in the list of available plugins. Install the plugin by clicking the “Install” button.

    Module installation

  • From the “Configuration -> System” menu, select the Auth0 plugin and configure it with the domain, client ID and client secret obtained from the Auth0 website. Click “Save” to save the changes.

    Module configuration

  • Log out of the Drupal administration panel.

You should now be able to log in to Drupal using Auth0 user credentials. The Drupal login page should also change to reflect Auth0 as a login option.

Drupal Auth0 login

Last modification June 16, 2021