Drupal
Configure wallet login through Keycloak using Drupal’s standard SimpleSAMLphp authentication module.
Connect Drupal to Keycloak through SimpleSAMLphp. Keycloak connects to the Ver.iD platform; Yivi is the example wallet.
What you need
First prepare your organization in Ver.iD Studio.
Drupal 10.6.19, SimpleSAMLphp Auth 4.1.0, ExternalAuth 2.0.15, SimpleSAMLphp 2.4.9.3 and authoauth2 5.2.0. Keep a local administrator login available. Install the modules through Composer and keep the deployment lockfile.
SimpleSAMLphp Auth has Drupal security-advisory coverage and minimal-maintenance status. Drupal 10 security support ends on 9 December 2026.
Configure Ver.iD
Add Keycloak's callback URL in Ver.iD Studio → Verify → Authentications → your flow → Redirect URIs: <keycloak-base-url>/realms/<realm>/broker/verid/endpoint. See Add redirect URIs. Your application callback is configured separately on its Keycloak client.
Configure Keycloak and SimpleSAMLphp
Apply the verified-contact post-login flow to the Ver.iD provider so both requested contacts and their verification flags are required before account access.
- Complete the Keycloak setup, including its protected wallet attributes and
verid-wallet-claimsscope. Enable Add to userinfo on that scope's wallet-claim mappers; keep Ver.iD's upstream UserInfo disabled. - Create a confidential OpenID Connect client with Standard flow = On. Disable Implicit flow, Direct access grants and Service accounts roles. Register
<drupal-base-url>/simplesaml/module.php/authoauth2/linkbackas its exact Valid redirect URIs entry. Assign onlybasicandverid-wallet-claimsas default client scopes, disable Full scope allowed and use RS256 ID-token signatures. - Enable SimpleSAMLphp's
authoauth2module. Add this source toconfig/authsources.php, preserving other sources:
'verid' => [
'authoauth2:OpenIDConnect',
'issuer' => getenv('DRUPAL_BROKER_ISSUER'),
'clientId' => getenv('DRUPAL_BROKER_CLIENT_ID'),
'clientSecret' => getenv('DRUPAL_BROKER_CLIENT_SECRET'),
'redirectUri' => rtrim(getenv('DRUPAL_BASE_URL'), '/')
. '/simplesaml/module.php/authoauth2/linkback',
'scopes' => ['openid'],
'validateIssuer' => true,
'pkceMethod' => 'S256',
'attributePrefix' => '',
'logHttpTraffic' => false,
'logIdTokenJson' => false,
],DRUPAL_BROKER_ISSUER is <keycloak-base-url>/realms/<realm>. Set these variables privately for the PHP service. The credentials are the Drupal client's Keycloak credentials. Set the client's PKCE method = S256.
Use SimpleSAMLphp's SQL session store, a stable private secret salt, HTTPS public baseurlpath and Secure/HttpOnly cookies. Drupal's module requires a session store separate from PHP's native session.
Configure Drupal
Enable simplesamlphp_auth. Under its configuration, use these keys in simplesamlphp_auth.settings:
| Setting | Value |
|---|---|
activate | true |
auth_source | verid |
unique_id | sub |
user_name | sub |
mail_attr | wallet_email |
register_users | true, for new-account login |
autoenablesaml | false |
sync.mail, sync.user_name | false |
role.population | Empty |
debug | false |
Rebuild Drupal's caches. Use the module's standard sign-in link on the login page. Keep automatic linking of existing accounts disabled and assign new accounts only ordinary authenticated-user permissions.
Test the login
Start the SimpleSAMLphp login from Drupal, approve the wallet request in Yivi and confirm Drupal opens a normal account. Sign out and repeat: the same account must return. Cancel a new request: no new Drupal session should appear.
Drupal profile fields remain editable account data. No separate wallet-contact module is required. For source options, see the versioned authoauth2 documentation.