Integrate Drupal 9.5/10 website with the Auth0 Single Sign-On (SSO) platform.
The Auth0 team has announced the retirement of their official Drupal 8 module. The Github repository will be available until March 8, 2022, after which it will be removed. The auth0 team recommends using the OpenID Connect / OAuth client drupal module as an alternative.
There was a need to include similar functionality in one of the project, but as the official module is deprecated we decided to write this module and make it public.
I would request to download the module and then customize it to fit the needs of their project. There will be no security audits or third-party testing for this module, so treat it as you would write a custom module developed for your project.
If you wish to go through the working of this module or how Auth0 SSO works check my blog Drupal 8/9: Integrating with auth0 on Medium.
Active releases and their compatibility.
Version | Drupal | Recommended | Docs |
---|---|---|---|
3.0.x | 9.5 and above | Yes | Docs |
2.0.x | >=8.x <=10.x | Yes | Docs |
1.0.x | >= 8.x <= 10.x | No | Docs |
The Drupal "authzero" module works only with Drupal Core version 9.5 and above. It requires the "auth0/auth0-php" version "8.10.1" of the library, which is added as a dependency in the drupal module composer.json file. Installing the drupal module will automatically install the correct version of the "auth0/auth0-php" library.
Version 3.0.0 is a complete rewrite / new implementation of the authzero drupal module. In the new version all the module settings are now stored using the "State API" and not as "Config API", this was done to avoid exporting "sensitive" auth0 credentials as config. New fields added in the settings form, allows for better control over the user actions viz. Login, Logout etc.
- Backup all the credentials.
- Uninstall the module older version any of "v2.0.0", "v1.0.5".
- Remove the "auth0/auth0-php:7.5" version library.
- Install the module and add the required info again.
Navigate to your site's modules directory and clone this repo:
$ cd PATH/TO/DRUPAL/ROOT/modules
$ git clone https://github.com/vishwac09/authzero.git authzero
$ composer install
From the root of your Drupal project run the below command. Link to Packagist
$ composer require vishwac09/authzero:3.0.0
The modules come with a settings form. To use it, go to https://SITE_DOMAIN/admin/config/auth0/settings and fill it out with all the necessary information. The authzero module won't function properly without it.
The module does not login any users who do not have an account on the site. You can achieve the same functionality using the hook mentioned above. Implement the hook in any custom module and write the code to create the user account.