Third-party integrations

Moodle

Configure Moodle’s built-in OAuth 2 login through Keycloak.

Use Moodle's built-in OAuth 2 authentication. Keycloak connects Moodle to the Ver.iD platform; Yivi is the example wallet.

What you need

First prepare your organization in Ver.iD Studio.

Moodle 4.5.15 LTS, Keycloak 26.8.1, HTTPS, working Moodle email delivery and a separate local administrator login. No Moodle login plugin is required.

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

  1. Complete the Keycloak setup with openid email phone, protected wallet attributes and the verid-wallet-claims client scope. Configure its verified-contact post-login flow.
  2. On the four wallet-claim mappers, enable Add to userinfo. Keep upstream Ver.iD UserInfo disabled.
  3. Create a confidential OpenID Connect client with Standard flow = On. Disable Implicit flow, Direct access grants and Service accounts roles. Register <moodle-base-url>/admin/oauth2callback.php as the exact Valid redirect URIs entry.
  4. Assign basic and verid-wallet-claims as default scopes; remove unused defaults. Moodle 4.5 does not send PKCE: leave this downstream client's PKCE requirement unset. Keep S256 on Keycloak's upstream Ver.iD connection.

Configure Moodle

Open Site administration → Server → OAuth 2 services → Custom:

SettingValue
NameWallet login
Client ID / Client secretThe Moodle client's Keycloak credentials
Authenticate token requests via HTTP headersOn
Service base URL<keycloak-base-url>/realms/<realm>
This service will be usedLogin page only
Name displayed on the login pageLog in with Digital Identity Wallet
Scopes included in a login requestopenid
Offline scopes / additional parametersEmpty
Require email verificationOn

Save. Under Configure endpoints, check the realm's discovered authorization, token and UserInfo endpoints. Under Configure user field mappings, use sub → username, wallet_email → email and wallet_phone_number → phone1.

Enable OAuth 2 under Plugins → Authentication → Manage authentication. Leave Prevent account creation when authenticating disabled for new-account login; enable it for linking-only installations.

Test the login

In a private browser window, choose the wallet button and approve the request in Yivi. Confirm Moodle's email, choose the wallet login again, then complete the required local profile fields. Confirm the student account opens with no additional roles or enrolments. Sign out and repeat: the same account must return. Cancel a new request: no new session should appear.

Keep Require email verification enabled. Existing students should sign in locally and use Preferences → Linked logins; do not enable automatic email-based account linking.

Optional badge delivery

The separate course-badge issuer adds wallet delivery for an earned badge. It is independent of login and is the only Moodle download in these guides.

On this page