Vendor configuration recipe; review against your vendor version. This page is not evidence of fresh external interoperability. Release verification scope.

Integrations · OIDC

Nextcloud SSO

Configure Nextcloud to authenticate users via Clavex using the user_oidc app. Supports automatic account provisioning, quota assignment, group membership, and avatar synchronisation from Clavex claims.

Prerequisites

Recommended app: Use the official user_oidc app by Nextcloud GmbH — it supports discovery, PKCE, and full claim mapping. The sociallogin app is a fallback for older Nextcloud versions.

Step 1 — Install user_oidc

bash
# Via Nextcloud app store (recommended) # Admin panel → Apps → Search "OpenID Connect user backend" → Install
# Or via occ CLI $ php occ app:install user_oidc $ php occ app:enable user_oidc

Step 2 — Register OIDC Client in Clavex

Register in the organization console. Create the matching OIDC application or downstream SAML application using its actual supported configuration. Copy the exact callback and required client credentials into the vendor configuration below. The management API uses an organization ID and typed request fields; follow the current OIDC guide and release API schema, rather than the obsolete client_name/scopes recipe. Keep credentials server-side.

Step 3 — Configure user_oidc in Nextcloud Admin

  1. Go to Admin Settings → OpenID Connect
  2. Click Add provider and fill in:
    FieldValue
    Identifierclavex
    Client IDnextcloud
    Client secretcs_xxxxxxxxxxxxxxxx
    Discovery endpointhttps://id.acme.eu/acme/.well-known/openid-configuration
    Scopeopenid profile email groups
  3. Expand Attribute mapping:
    Nextcloud attributeClavex claim
    User IDsub
    Display namename
    Emailemail
    Quota(leave empty or map from custom claim)
    Groupsgroups
  4. Enable Use PKCE (recommended)
  5. Click Save

Step 4 — Configure via occ CLI (alternative)

bash
$ php occ user_oidc:provider clavex \ --clientid="nextcloud" \ --clientsecret="cs_xxxxxxxxxxxxxxxx" \ --discoveryuri="https://id.acme.eu/acme/.well-known/openid-configuration" \ --scope="openid profile email groups" \ --mapping-uid="sub" \ --mapping-displayname="name" \ --mapping-email="email" \ --mapping-groups="groups" \ --pkce=1

Step 5 — Disable Local Login (optional)

Once SSO is working, disable password-based login to enforce Clavex as the only auth method:

bash
# Disable local password login for non-admin users $ php occ config:app:set --value=0 user_oidc allow_multiple_user_backends

Troubleshooting

SymptomCauseFix
Login button not shown on Nextcloud login page user_oidc app not enabled or no provider configured Run php occ app:enable user_oidc and verify provider list
Error: The provided code is not valid Redirect URI mismatch Ensure redirect URI in Clavex matches /apps/user_oidc/code exactly
Groups not syncing groups scope not requested or claim not included Verify scope includes groups; ensure Clavex client is configured to return groups claim
Duplicate user accounts User ID claim changed (e.g. email vs sub) Always use sub as the User ID — it is stable and unique across sessions
SSL certificate error Nextcloud can't verify Clavex cert Add Clavex CA to Nextcloud's trusted certs: php occ security:certificates:import clavex-ca.crt