Third-party integrations

Nextcloud

Configure wallet login through Keycloak with Nextcloud’s native OIDC user backend.

Connect Nextcloud to Keycloak using its OpenID Connect user backend.

What you need

First prepare your organization in Ver.iD Studio.

Use Nextcloud 34.0.5 with OpenID Connect user backend (user_oidc) 8.13.0. Keycloak connects to the Ver.iD platform; Yivi is the example wallet. Keep a local administrator login available.

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

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.

  1. Complete the Keycloak setup with protected contact attributes. Use a dedicated realm and a confidential Nextcloud client with Standard flow = On, RS256 ID tokens and PKCE method = S256. Disable Implicit flow, Direct access grants and Service accounts roles.
  2. Copy the native redirect URL from Administration settings → OpenID Connect into Valid redirect URIs. This installation uses <nextcloud-base-url>/apps/user_oidc/code; retain the exact URL generated by your installation.
  3. On this client's dedicated scopes, map protected verid_email → email, verid_email_verified → email_verified, verid_phone_number → phone_number and verid_phone_number_verified → phone_number_verified. Use User Attribute mappers, boolean types for flags, Add to ID token = On and other outputs Off. Remove competing editable-profile mappers.
  4. Assign only basic, email and phone as default scopes. Keep the upstream Ver.iD provider's UserInfo disabled.

Configure Nextcloud

Install and enable user_oidc. Merge these settings into config/config.php, preserving unrelated settings:

'user_oidc' => [
    'use_pkce' => 'force',
    'default_token_endpoint_auth_method' => 'client_secret_post',
    'enable_default_claims' => false,
    'send_userinfo_claims' => false,
    'enrich_login_id_token_with_userinfo' => false,
    'login_validation_audience_check' => true,
    'login_validation_azp_check' => true,
    'login_validation_nonce_check' => true,
    'validate_jwk_strength' => true,
    'httpclient.allowselfsigned' => false,
    'auto_provision' => true,
    'soft_auto_provision' => false,
    'disable_account_creation' => false,
    'user_search_match_emails' => false,
    'user_id_regexp' => '',
    'userinfo_bearer_validation' => false,
    'selfencoded_bearer_validation' => false,
    'oidc_provider_bearer_validation' => false,
    'single_logout' => false,
],

Store the Keycloak client secret in a mode-0600 file outside the web root, owned by Nextcloud's service user. From the installation directory, substitute that service user and your connection values:

sudo -u www-data php occ user_oidc:provider verid-nextcloud \
  --clientid='nextcloud-wallet' \
  --clientsecret-file='/path/to/private/nextcloud-keycloak-secret' \
  --discoveryuri='<keycloak-base-url>/realms/<realm>/.well-known/openid-configuration' \
  --scope='openid email phone' \
  --mapping-uid='sub' \
  --mapping-email='email' \
  --mapping-phone='phone_number' \
  --extra-claims='email_verified phone_number_verified' \
  --unique-uid=1 \
  --mapping-display-name='' \
  --mapping-quota='' \
  --mapping-groups='' \
  --mapping-group-admin-for='' \
  --group-provisioning=0 \
  --group-restrict-login-to-whitelist=0 \
  --group-forbid-login-without-group=0 \
  --entraid-group-names=0 \
  --resolve-nested-claims=0 \
  --check-bearer=0 \
  --bearer-provisioning=0 \
  --use-private-key-jwt=0 \
  --send-id-token-hint=0

Keep the local login available and require HTTPS:

sudo -u www-data php occ config:app:set user_oidc allow_multiple_user_backends --type=string --lazy --value=1
sudo -u www-data php occ config:app:set user_oidc allow_insecure_http --type=boolean --lazy --value=false

The discovery URL belongs to Keycloak. Studio credentials stay on Keycloak. Keep the provider, issuer and sub mapping stable: provider-specific unique IDs preserve the same Nextcloud account. Soft provisioning and email-based account reuse remain disabled.

Test the login

Select the OIDC provider in a private browser, approve the wallet request in Yivi and confirm Nextcloud opens a separate ordinary account. Check the mapped contacts under Personal settings → Personal info. Create a folder, sign out and sign in again: the same account and folder must return. Cancel a fresh request: no new session should appear.

Profile fields follow Nextcloud's editing policy; no extra contact-panel app is needed. For provider options, see the 8.13.0 command reference.

On this page