Search Results :

×

Configure Role-Based User Sync for Drupal Auth0


The Role-Based User Sync feature allows you to automatically synchronize users from Auth0 to Drupal based on their Auth0 roles. It creates new Drupal user accounts and assigns the appropriate Drupal roles using the role mappings you configure, helping you manage user access with minimal manual effort.

  • Go to the User Sync tab of the module.
  • Set Roles per page. This controls how many roles are pulled per API request.
    • Default: 100
    • Maximum allowed: 100
    • Leave this at the default unless you have a specific reason to change it.
  • Click Fetch Roles from Auth0.
    • This pulls all roles currently defined in your Auth0 tenant and stores them locally.
    • Once complete, you should see the fetched roles listed where it currently says "No roles fetched yet."
Drupal Auth0 User Sync - Fetch Roles from Auth0

  • Roles Successfully Fetched from Auth0.
Drupal Auth0 User Sync - Roles fetched from Auth0

This helps Drupal assign the right role to users based on their Auth0 role.

  • In the Auth0 Role column, select an Auth0 role that you fetched in the step above.
  • In the Drupal Role column, select the Drupal role you want to assign.
  • Click Add Row to map additional Auth0 roles.
  • To remove a mapping, click the Delete button for that row.
  • After configuring all the role mappings, click Save Role Mappings.
Drupal Auth0 User Sync - Save Role Mappings

In this step, you can synchronize users from Auth0 to your Drupal site. During the sync, Drupal creates user accounts and assigns roles based on your role mappings.

  • In the Users per page field, enter the number of users to fetch in each request.
  • The default value is 100.
  • Click Run Manual Sync Now to start the synchronization.

Sync Options

  • Sync only users from mapped roles
    • Enabled: Only users with mapped Auth0 roles are synchronized.
    • Disabled: All Auth0 users are synchronized, regardless of role mapping.
  • Auto-create Drupal role for unmapped roles
    • Enabled: If an Auth0 role is not mapped to a Drupal role, the module automatically creates a Drupal role with the same name and assigns it to the user.
    • Disabled: Only the roles you mapped in Step 2 are assigned. Unmapped roles will not be created automatically.
note

Note: Disable this option if you want to manage all Drupal roles manually.


  • Enable automatic sync via cron
    • Enabled: Users are synchronized automatically whenever Drupal cron runs.
    • Disabled: You need to click Run Manual Sync Now each time you want to synchronize users.
  • After configuring the settings, click Save Settings.
Drupal Auth0 User Sync - Sync options and Run Manual Sync Now

You have successfully configured Role-Based User Sync. New users from Auth0 will be automatically synchronized to Drupal and assigned the corresponding Drupal roles.



Role-Based User Sync allows you to synchronize users from an external identity provider with Drupal and manage their access based on assigned roles.

Role mapping ensures that users receive the appropriate permissions in Drupal based on their roles in the identity provider, helping maintain consistent access control.

Yes, user synchronization can be automated using Drupal cron, reducing the need to initiate the synchronization process manually.

Depending on the module configuration, you can create a corresponding Drupal role automatically or restrict role assignment to predefined mappings.

Yes, you can configure synchronization settings to determine whether only users with mapped roles or all users from the identity provider are synchronized.

Integrating Auth0 with Drupal helps centralize user management, automate account creation, simplify role assignment, and reduce manual administrative work.


 Thank you for your response. We will get back to you soon.

Something went wrong. Please submit your query again



ADFS_sso ×
Hello there!

Need Help? We are right here!

support