Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Statistics Counter Module statistics_counter crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module enhances the Keycloak User Sync module by automatically sending account setup emails to new Drupal users. It also synchronizes user's first and last names, manages their group memberships in Keycloak, and sets their language locale.

Keycloak Registration is a companion module to Keycloak User Sync. It fills three gaps that Keycloak User Sync cannot cover through its own configuration, so that a user created in Drupal is fully provisioned in Keycloak — with their real name, their group memberships, and the account-setup email that actually lets them log in.

The two modules are designed to work together: Keycloak User Sync creates, updates, and deletes the Keycloak user and its flat attributes; Keycloak Registration layers the remaining provisioning on top.

Features

  • First/last name sync — reads a compound Name field (its given/family columns) from a configurable source entity (e.g. a Profile, or the user itself) and pushes it to Keycloak firstName/lastName. Keycloak User Sync can only map flat field values.
  • Group membership sync — maps a user field holding Keycloak group names to the user's top-level Keycloak group memberships (nested group trees are searched). Optionally removes memberships not present in the field, or leaves groups managed directly in Keycloak untouched.
  • Account-setup ("welcome") email — triggers Keycloak's execute-actions-email, so a newly created user actually receives the "set password / verify email" message. Keycloak User Sync only sets required actions; it never asks Keycloak to send the email. Sent exactly once per user, with a configurable minimum delay and cron-based retries.
  • Locale sync — sets the Keycloak user's locale from the Drupal account language, so the email and its action link render in the user's language.

Requirements

  • Keycloak User Sync, installed and configured (this module reuses its connection and service-account credentials from settings.php).
  • The Keycloak service-account client needs the realm-management roles manage-users, view-users, query-users, and query-groups.
  • Keycloak realm SMTP must be configured to deliver the account-setup email.
  • Optional: the Name module for the first/last name sync feature.

Installation

  1. Install as you would normally install a contributed Drupal module: composer require drupal/keycloak_registration.
  2. Enable the module. It sets its own module weight to 10 so its hooks run after Keycloak User Sync's — the Keycloak user must already exist when this module looks it up.

Configuration

Configure the module at Administration » People » Keycloak Registration (/admin/people/keycloak-registration): enable the account-setup email and the group/name sync features, and point them at your field machine names. The Keycloak connection itself comes from Keycloak User Sync's settings:

$settings['keycloak_user_sync.connection'] = [
  'url'   => 'https://keycloak.example.com',
  'realm' => 'your-realm',
];
$settings['keycloak_user_sync.credentials'] = [
  'client_id'     => 'drupal-sync',
  'client_secret' => '…',
];

Use cases

  • Editorial or HR workflows where accounts are created in Drupal and users must receive a Keycloak "set your password / verify your email" message automatically.
  • Sites storing structured names in a compound Name field (e.g. on a Profile) that should appear as first/last name in Keycloak and downstream SSO clients.
  • Managing Keycloak group memberships from Drupal user data — additively, or authoritatively with removal of unmanaged memberships.

Activity

Tracked releases
4
Tracked since
Aug 2026
Latest release
4 days ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.2.5 Stable Aug 20, 2026
1.2.0 Stable Aug 19, 2026
1.1.0 Stable Aug 19, 2026
1.0.0 Stable Aug 19, 2026