Keycloak and Nextcloud SSO integration

This page explains how to sign in to self-hosted Nextcloud through Keycloak with the user_oidc app, what the team must configure on each side, and where provisioning, LDAP and logout projects usually stall.

On this page

Keycloak and Nextcloud SSO integration: what the user_oidc connection covers

An organization that runs Nextcloud and Keycloak and wants staff to sign in once needs to know which Nextcloud mechanism carries that sign-in. The supported route is OpenID Connect through the user_oidc app. This page covers claim-based user and group provisioning, soft provisioning for users who already exist in LDAP, bearer token validation for API and client access, and backchannel logout so that a session ended in Keycloak also ends in Nextcloud. Each of these behaves differently, and the scope decisions made here shape every later step.

The Nextcloud LDAP app and the OIDC user backend are separate paths, and they should not be treated as interchangeable. The LDAP app reads users and groups directly from a directory and authenticates them with their directory credentials. The user_oidc app authenticates users against Keycloak and creates or updates the Nextcloud account from the claims in the token. If your staff already exist in an LDAP or Active Directory tree that Keycloak federates, you still have to decide which Nextcloud backend owns each account, because the two paths can produce duplicate or conflicting users if both are active without a clear rule.

Setting names, claim options and provisioning flags in user_oidc change between app releases. Before you write any configuration, confirm the exact settings against the user_oidc documentation for the Nextcloud release you run. Nextcloud does not allow skipping major releases, so the app version you validate in a test instance is the one that must match your production upgrade path. Record the Nextcloud version, the user_oidc version and the Keycloak release together in your design notes, because a later upgrade of any one of them can change how claims are read.

The decisions to make early are concrete. Confirm which Keycloak claim carries the Nextcloud user identifier and whether that value is stable over time. Decide which group claim will drive Nextcloud group membership and who maintains the Keycloak groups it reads. Choose whether existing LDAP users will be matched to OIDC identities by a shared attribute or migrated by a one-time process. Each choice affects who can sign in, how group-based sharing behaves and how an offboarded user is removed. Write these answers down before the Keycloak client is created.

What must be in place before the Keycloak and Nextcloud SSO work starts

Most delays in Keycloak and Nextcloud SSO projects come from versions, hostnames and network paths that were never agreed before the build began. The six items below are the decisions and checks to close first, because each one changes the configuration that follows.

Keycloak release and production database

Start from the current Keycloak release, 26.8.1, published October 13, 2026, and read its upgrade notes before configuring anything. The production database must come from Keycloak's supported list, which includes PostgreSQL 14 to 18, and the development file database is for development only. Decide whether schema migration runs automatically at startup or manually, and confirm that database backup and restore work before go-live.

Nextcloud 35 and its server stack

Nextcloud 35 (Hub 26 Summer) was released on September 16, 2026. Its system requirements recommend MariaDB 11.8 or PostgreSQL 18, with MariaDB 10.11 to 12.3, PostgreSQL 14 to 18 and MySQL 8.4 or 9.7 also supported. Plan PHP 8.5 (8.3 and 8.4 are supported) and Apache 2.4 or nginx with php-fpm, then confirm that the user_oidc app supports this exact Nextcloud version.

Nextcloud release schedule and upgrade path

Check the end-of-life date of each candidate major version against your go-live date and your operating window. Nextcloud 35 receives support until September 2027, Nextcloud 34 until June 2027, Nextcloud 33 until February 2027, and Nextcloud 36 is scheduled for February 17, 2027. Nextcloud does not allow skipping major releases, so plan each step with a backup beforehand and third-party apps disabled until they are confirmed compatible.

TLS on both public hostnames

Give Keycloak and Nextcloud separate public hostnames, each with a certificate that browsers and the other server trust. Keycloak's production guide calls for TLS on all communication and asks that the admin console and Administration REST API use a different hostname or context path from public frontend URLs. If your certificates come from an internal CA, confirm that the Nextcloud PHP runtime trusts that CA for calls to Keycloak.

Reverse proxy and network paths

Run Keycloak behind a reverse proxy that restricts paths, so only the endpoints that users and applications need are published. List every network path before the build: browsers to both hostnames, Nextcloud to Keycloak for token, userinfo and JWKS endpoints, and Keycloak to Nextcloud if backchannel logout is enabled. Open only those flows in firewalls and load balancers, and test each one from the server that will call it.

LDAP or Active Directory directory

If users live in LDAP or Active Directory, decide which system owns each identity before the build starts. Nextcloud's LDAP app lets directory users sign in with their directory credentials, which is a separate path from Keycloak user federation, so both paths must resolve the same account to the same user. Collect the directory host, bind account, base DNs and group attributes, and confirm that both servers can reach the directory.

How Keycloak and Nextcloud SSO exchange tokens at sign-in

The sign-in flow is an OpenID Connect authorization code exchange in which Keycloak handles the password and any second factor, and Nextcloud only receives the result. When a user opens Nextcloud, the user_oidc app redirects the browser to the Keycloak realm's authorization endpoint with the Nextcloud client ID and a redirect URI pointing back to Nextcloud. The user authenticates in Keycloak, which may also enforce MFA, passkeys or a conditional authentication step defined in your realm. Keycloak then sends the browser back to Nextcloud with a short-lived authorization code. Nextcloud, through user_oidc, exchanges that code directly with Keycloak's token endpoint over a back-channel request, which is why the client secret and the token endpoint must be reachable from the Nextcloud server as well as from the browser.

The token response contains an ID token, and usually an access token and a refresh token, depending on the client configuration. Nextcloud reads identity claims from the ID token or the userinfo endpoint, such as the subject, preferred username, email and any group claim you have mapped. The user_oidc app uses these claims to create a local Nextcloud account on first sign-in or update attributes on later sign-ins. Group membership is only synchronized if the claim is present and the app is configured to read it, so the claim name, its format and its values must match what the user_oidc settings expect. Mismatches here are the most common cause of users who log in successfully but land with no group rights.

Bearer token validation is a separate path from browser sign-in. Desktop and mobile sync clients, and scripts that call Nextcloud APIs, present an access token in the Authorization header. Nextcloud must then validate that token against Keycloak, typically by checking its signature against the realm's published keys or by calling an introspection endpoint, and confirm the audience and expiry. Decide which clients will use bearer tokens, which scopes they need and whether you want Nextcloud to accept tokens issued to other clients. Confirm in the user_oidc documentation for your installed version which validation methods it supports and how it is enabled, because this behavior has changed between releases.

Backchannel logout is the path that ends Nextcloud sessions when a user logs out of Keycloak or an administrator revokes a session. Keycloak sends a signed logout token as a direct server-to-server request to a logout endpoint registered for the Nextcloud client, so the Nextcloud server must be reachable from Keycloak, and that endpoint must be enabled in the user_oidc settings and the Keycloak client. Browser-based front-channel logout is a different mechanism and depends on the browser. Plan for the case where a session is not terminated because the backchannel request failed, and decide how long you accept that exposure. Keycloak 26.8 upgrade notes state that backchannel logout tokens from external providers must have their signatures validated, so confirm how your Nextcloud and user_oidc versions handle this before relying on it.

Before go-live, verify the redirect URI, callback path, logout endpoint and token settings against the user_oidc documentation for the exact Nextcloud and app versions you run, since these paths and option names are version-specific. Confirm the access token lifetime, refresh behavior and whether refresh tokens are issued to the Nextcloud client. Test a full sign-in, a token-based API call, a sign-out from Keycloak and an administrator-forced session revocation, and record which step fails and why. These checks identify configuration errors early and show who owns each part of the flow: the realm, the client, the Nextcloud server and the network path between them.

Configuring Keycloak and Nextcloud SSO in sequence

This sequence moves from a Keycloak client to a working Nextcloud sign-in, then adds group provisioning and session controls. Each step closes with a check, so a fault is found before the next layer is added. The result is a Nextcloud instance that signs users in through Keycloak and passes a written test plan.

  1. Confirm or create the Keycloak realm

    Your Keycloak administrator either confirms an existing realm for the Nextcloud integration or creates a dedicated one, so Nextcloud clients, users and groups stay separate from other applications. Decide early whether users come from Keycloak's own user store, from an existing LDAP or Active Directory federation, or from both, because that choice shapes the later steps. Check: the realm loads in the admin console, its login page is reachable over HTTPS from the Nextcloud server, and its users and groups are visible in the admin console.

  2. Create the confidential Nextcloud client

    Create an OpenID Connect client in the realm for Nextcloud with client authentication turned on, so Keycloak issues a client secret that Nextcloud keeps on the server side. Set the valid redirect URI to the exact value the user_oidc app displays in its settings, including scheme, host and path, because any mismatch blocks sign-in. Confirm the redirect URI against the user_oidc documentation for your Nextcloud version. Check: the client shows a secret on its credentials tab, and the redirect URI matches the value copied from Nextcloud character for character.

  3. Add protocol mappers for identity claims

    Add mappers to the client so tokens carry a username, email address, display name and a groups claim. Map the username to the claim that user_oidc reads for the account identifier, map email and display name from the user profile, and add a group membership mapper that writes group names into a named claim. Keep full group paths off unless your group design needs them. Check: sign in once with a test user, decode the ID token or access token in a token viewer, and confirm each claim is present with the expected value.

  4. Install and configure the user_oidc app

    Install the user_oidc app in Nextcloud through the app management page, then enter the Keycloak issuer URL for the realm, the client ID and the client secret created in the second step. Confirm that the Nextcloud server can reach the discovery endpoint and trusts the TLS certificate of the Keycloak host, since a failed trust chain is a common cause of setup errors. Check: the provider appears in the admin settings with its issuer and discovery data loaded, and the Nextcloud login page shows a Keycloak sign-in option.

  5. Set the user ID attribute and test sign-in

    Choose the claim that becomes the Nextcloud user ID. Use a stable identifier that users cannot change, such as a subject or employee ID, and set it in the provider's attribute mapping. Then sign in with a non-admin test account, because administrator accounts can hide problems with group rights and quotas. Check: the account is created with the expected user ID, its display name and email are populated, and the user can open files without administrator rights.

  6. Enable group provisioning from the claim

    Turn on group provisioning in user_oidc so Keycloak group names from the groups claim create and update Nextcloud group membership at sign-in. Decide which groups map to Nextcloud groups and which are ignored, and assign any administrator group only after the non-admin test passes. If an existing LDAP or Active Directory directory is in scope, configure soft provisioning as a separate step, scoped to that directory, and confirm in the user_oidc documentation how it matches existing accounts. Check: a user added to a test group in Keycloak lands in the matching Nextcloud group after a fresh sign-in.

  7. Enable bearer token validation and backchannel logout

    Enable bearer token validation so requests that carry a Keycloak access token are checked against the issuer and signature before Nextcloud accepts them. Confirm which client flows your applications use before you switch it on. Then configure backchannel logout by giving Keycloak the logout endpoint that user_oidc exposes, so ending a session in Keycloak also ends the Nextcloud session. Keycloak 26.8 requires signature validation of backchannel logout tokens from external providers, so confirm your setup accepts that. Check: a token from a test client is accepted by a Nextcloud API endpoint, and after the test user's session ends in Keycloak, the next Nextcloud request is refused.

  8. Run the integration test plan

    Run a written test plan that covers first sign-in, group changes, an administrator account, a disabled Keycloak user, a password or MFA change, token expiry and logout from both ends. Record each result with the Keycloak and Nextcloud versions tested. Repeat the plan after each Keycloak minor release and each Nextcloud major upgrade, since both projects ship on a regular schedule. Check: every case passes or has a recorded and accepted exception, and the signed-off plan is stored alongside the configuration backup.

Which Keycloak claims map to Nextcloud accounts, groups and quotas

This table lists each Keycloak source, the token claim or attribute that carries it, the Nextcloud field or behavior it feeds, and what your team should confirm before go-live. Read it as a checklist for the mapper configuration and the Nextcloud test plan. The main takeaway is that group names must match exactly in both systems, and that any claim you do not confirm in the app documentation should stay unmapped until it is verified.

Keycloak sourceToken claim or attributeNextcloud field or behaviorWhat to confirm
User identifierStable subject claim (sub) or a chosen immutable attributeInternal Nextcloud user ID linked to the OIDC identityConfirm the claim is unique and never reassigned, and that it is the value Nextcloud uses to match returning users
Usernamepreferred_username or a dedicated username mapperNextcloud login nameConfirm which claim the user_oidc app reads for the username and whether usernames can change in Keycloak without creating a duplicate account
Email addressemail claim, with email_verified where policy requires itNextcloud account email used for notifications and sharingConfirm the mapper includes only verified addresses and that Nextcloud accepts updates to an existing account's email
Display namename or given_name plus family_nameNextcloud display name shown in sharing and activityConfirm the claim format and whether the display name is overwritten on each login or only at first provisioning
Group membershipgroups claim, added with a group membership mapper with full path disabledNextcloud groups created or joined at loginConfirm the claim contains short group names and that every Keycloak group name matches the Nextcloud group name exactly, including case
Admin groupThe same groups claim, checked for a dedicated admin groupNextcloud administrator rights for members of the mapped groupConfirm the exact group name the app uses for admin assignment and test with a non-production admin account before enabling it
Quota or storage attributeCustom user attribute, only if your team sets quotas in KeycloakNextcloud user quota, if the app applies it from the claimConfirm the app supports reading quota from a token claim at all; if not, set quotas in Nextcloud or through your own provisioning process
LDAP attributes used in soft provisioningDirectory attributes such as uid, mail and cn, read through the Keycloak LDAP federation providerExisting LDAP users matched to Nextcloud accounts at first OIDC sign-inConfirm the LDAP attribute used to match identities matches the Nextcloud identifier, and test with an account that exists in both directories

How soft provisioning treats existing LDAP accounts in Keycloak and Nextcloud SSO

The first decision is whether a successful Keycloak sign-in should create a new Nextcloud account or attach to an account that already exists. Creating from the token means the first login builds a local Nextcloud user from the claims in the token. Linking means the sign-in is matched to a user that already came from a directory, either through Nextcloud's LDAP app, which lets LDAP and Active Directory users log in with their directory credentials, or through the LDAP or Active Directory user federation that Keycloak documents. If both paths feed the same person, the wrong setting produces a second account for one employee, with its own files, shares and group memberships. Before enabling soft provisioning, confirm in the current user_oidc and Nextcloud LDAP documentation how each product matches an incoming identity to an existing user.

Duplicate accounts usually come from identifiers that differ between sources. Keycloak may import the directory username as the federated username, while the token carries an email address or a preferred username from another source, and Nextcloud may key users on a different attribute again. Choose one authoritative identifier for each person, ideally an attribute that does not change when a person's name or email changes, and map it consistently in Keycloak's attribute mappers and in Nextcloud's LDAP attribute settings. Then test the mapping with three cases: a directory user signing in for the first time, a user who exists in Keycloak but not in the directory, and a user whose email address changed in the directory after their first sign-in. Use test accounts created for this purpose, and record which account each login resolved to.

Group membership is the second source of conflict. A person can receive groups from the directory through Keycloak's federation mappers, from Keycloak-local group assignments, and from a groups claim in the token. Nextcloud can also sync groups directly from LDAP. When two sources assign the same group, or when one source removes a membership the other still asserts, the result depends on which sync runs last. This matters most for groups that grant administrator rights, group folder access or storage quotas. For each Nextcloud group, decide which system owns its membership and make sure the other sources do not write to it.

Before turning on soft provisioning, write a short ownership table that lists each attribute and group that Nextcloud stores for a user, such as username, email, display name, group membership, quota and admin rights, and name the system that owns each one. Keycloak, the directory and Nextcloud should each write only the attributes they own. Then verify the behavior that matters most: a disabled directory account should lose access to Nextcloud, a deleted group should stop granting access, and a changed attribute should update in the place the table names as the owner. Confirm each of these against the sync and disable settings in the versions you run, because account lifecycle behavior differs between LDAP-backed and token-created users.

Security settings for Keycloak and Nextcloud SSO

These settings sit at the boundary between Keycloak, Nextcloud and the network between them. Each one limits a specific way that sign-in can be intercepted, redirected, replayed or escalated into administrator rights. Review them together before go-live, because a strong MFA policy does not help if the client secret is in a public repository or a broad claim maps every user to an admin group.

HTTPS on every hop

Terminate TLS for the Keycloak frontend, the Nextcloud instance and the backchannel calls between Nextcloud and Keycloak, including token and userinfo requests. Keycloak's production guide expects TLS on all communication, and it is easy to miss the backchannel path because it never shows in a browser. Confirm the certificate chain is trusted by the Nextcloud server itself, and confirm the public frontend URL in Keycloak matches the HTTPS address users see.

Client secret outside version control

The Nextcloud user_oidc configuration needs the Keycloak client secret, and it is often pasted into a config file that gets committed. Store the secret in a secrets manager or an environment variable injected at deploy time, and rotate it if it has ever been stored in a repository or shared channel. Check that backups of the Nextcloud config directory are protected to the same standard as the secret itself.

Separate admin console hostname

Keycloak's production guide recommends exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. Configure the reverse proxy to serve only the public login paths on the internet-facing hostname and restrict the admin hostname to management networks. Test that the admin paths return errors from the public side before you rely on this control.

Exact redirect URI values

Register each Nextcloud redirect URI as a full, exact value in the Keycloak client, and avoid wildcards or trailing path patterns. An open redirect pattern lets an attacker receive authorization codes for a session they control. Review the list after every Nextcloud domain change, because a retired hostname left in the list remains a valid target.

Token lifetimes and session settings

Set access token lifetime, SSO session idle and maximum values, and the client session limits in Keycloak to match your data sensitivity and your Nextcloud desktop and mobile sync behavior. Long-lived sessions widen the window after a laptop is lost, while very short ones can interrupt sync clients. Test sync clients after each change, and record the values you chose so auditors can trace them.

MFA or passkeys for sign-in

Require a second factor or a passkey in a Keycloak authentication flow that applies to the Nextcloud client, so the protection does not depend on the Nextcloud login page. Keycloak documents OTP policies, WebAuthn and passkeys with conditional and modal UI, and recovery codes. Decide how users recover access when they lose a device, and confirm that sync clients which cannot complete an interactive prompt behave as you expect.

Admin group claim controls

Map Keycloak groups to Nextcloud administrator rights only through an explicit, narrow group name, and never through a claim that a user can influence from their own profile. A broad or misconfigured mapper can grant administrator rights to users who were never intended to have them. Review the mapper in Keycloak and the admin group list in Nextcloud after each change, and log who holds the group.

Metrics for sign-in failures

Start Keycloak with --metrics-enabled=true so that Prometheus-format metrics are exposed at /metrics on the management interface. Keep that interface off the public network, then scrape it and alert on spikes in failed logins, which can indicate credential stuffing or a broken client after a change. Keycloak 26.8 persists login failures to the database by default, so confirm your retention and review process for those records as well.

How to test provisioning, bearer tokens and logout before go-live

Before go-live, the team should run a scripted test plan that proves the Keycloak and Nextcloud integration does what the design says for each identity path. Sign-in working once is not enough. The tests need to cover first sign-in, returning users whose group membership has changed, removed users, existing LDAP users under soft provisioning, API calls that carry a bearer token, and logout started in Keycloak. Each test should have a named owner, a pass condition written before the run, and a place to store evidence. Agree on this plan with the security team before the first test runs, because the same plan is what you will repeat later.

Start with first sign-in. Create a test user in the Keycloak realm that carries the group claims your mapping expects, sign in to Nextcloud through the user_oidc login, and confirm that the account appears with the expected display name, email address and group memberships. Then repeat for a returning user whose Keycloak group membership changed since the last sign-in. The pass condition is that Nextcloud reflects the current groups, not the groups from the first login, and that any group the user lost no longer grants access. Next, disable or delete a test user in Keycloak and confirm what Nextcloud does on the next sign-in attempt and on any scheduled sync. Record the behavior exactly, because it is the behavior your offboarding process will depend on.

For an existing LDAP user under soft provisioning, sign in with the directory credentials and confirm that Nextcloud links the account to the OIDC identity without creating a duplicate user. Check that the stored user ID, the attribute mapping and the group membership match what the directory and the Keycloak token say. For bearer tokens, obtain an access token for a client that is allowed to call a Nextcloud API, send a request with the Authorization header, and confirm that the request is accepted. Then send an expired token and a token whose audience or issuer does not match, and confirm that each is rejected. These checks depend on the token validation settings you chose, so confirm them against the user_oidc documentation for your release rather than from memory.

Logout is the test most often skipped. Start a Nextcloud session through Keycloak, then end the Keycloak session from the Keycloak account console or an admin action, and confirm that the Nextcloud session is terminated on the next request or after the backchannel logout message is processed. Verify that the backchannel logout endpoint is reachable from Keycloak and that signature validation of logout tokens is enabled, which the Keycloak 26.8 upgrade notes make mandatory for tokens from external providers. Keep the evidence for every test. Store token samples with the signature, client secret, refresh token and personal data removed, but keep the header, the claim names, the expiry and the audience so a reviewer can see what was checked. Save the Nextcloud log entries for each sign-in and rejected request, and record a dated export of the Keycloak client settings for the Nextcloud client, including redirect URIs, mappers and logout URI.

Repeat the same test plan after every Keycloak minor release and after every Nextcloud major upgrade. Keycloak plans four minor releases a year, and Nextcloud publishes a new major version every four months, so the schedule matters for budgeting the retest effort. Each rerun should use the same users, the same expected results and the same evidence format, so differences are easy to see. Treat a changed result as a finding to resolve before the upgrade is accepted, and do not assume that a passing sign-in means provisioning, token checks and logout still work. Ask any partner quoting this work to show how the retest is scoped, who runs it, and whether it is covered by a retainer or billed for each upgrade.

Why Keycloak and Nextcloud SSO sign-in fails and how to fix it

This table pairs common Keycloak and Nextcloud sign-in failures with their likely causes and first fixes. Read each row by matching the symptom your users or logs show, then check the cause in both the Keycloak client and the Nextcloud user_oidc settings before changing anything. The main takeaway is that many failures come from a mismatch between the URLs, claims or clocks the two servers expect, so compare those values side by side first.

SymptomLikely causeFix
Redirect URI mismatchKeycloak client redirect URI does not exactly match the callback Nextcloud sends, such as scheme, port or trailing slash.Copy the exact callback URL from Nextcloud into the client's valid redirect URIs, then retest using the public hostname users type.
Groups claim missing or wrongThe client has no group membership mapper, or the claim name differs from the group claim set in user_oidc, so no groups arrive.Add a group membership mapper with the claim name Nextcloud reads, then sign in with a test user and inspect the token.
Duplicate usernames after soft provisioningAn LDAP user already exists, and the OIDC username differs in case or format, so a second account is created.Align the username claim with the LDAP attribute, then confirm with a test account that the existing user is matched before enabling provisioning widely.
Logout does not end the Nextcloud sessionBackchannel logout is not configured on the client, so the Nextcloud session stays active after Keycloak logout.Configure the backchannel logout URL and session settings on both sides, then test logout from Keycloak and from Nextcloud separately.
Bearer tokens rejectedThe token audience omits the client Nextcloud expects, or the issuer URL differs from the one configured in Nextcloud.Add an audience mapper for the expected client, and set the issuer to the exact Keycloak realm URL, including hostname and realm name.
Certificate trust errors between serversNextcloud cannot verify Keycloak's TLS certificate because the chain is incomplete or the internal CA is missing from its trust store.Install the internal CA chain on the Nextcloud host, then confirm the connection with a request made from the Nextcloud server itself.
Clock skewKeycloak, Nextcloud and any proxies drift apart in time, so tokens appear expired or not yet valid to one side.Sync all hosts to the same time source, and recheck token lifetimes after any host or virtual machine change.
Keycloak 26.8 backchannel logout token validationThe 26.8 upgrade notes make signature validation mandatory for backchannel logout tokens from external providers, which may affect your logout flow.Read the 26.8 upgrade notes, confirm whether this applies to your logout path before upgrading, then test logout end to end.

What buyers ask about Keycloak and Nextcloud SSO before hiring help

How many realms and clients affect the cost of a Keycloak and Nextcloud SSO project?

Each realm and each client adds configuration, testing and review work, so one realm with one Nextcloud client is the smallest case. The number of realms matters when different user populations need separate login rules, token settings or administrators. Clients matter when Nextcloud is one of several applications that each need their own OpenID Connect registration, redirect URIs and mappers. What to ask for: a list of realms with their purpose, the clients planned for each, and whether any of them share users or groups. Ask how the scope changes if a second realm or a second Nextcloud instance is added. Scope is agreed in writing before work starts, so these counts should be settled early.

Is LDAP soft provisioning included in the Keycloak Nextcloud scope?

It is included only when the written scope says so, and it is one of the larger effort drivers in this integration. Soft provisioning lets existing LDAP or Active Directory users sign in to Nextcloud and receive their account on first login, while the directory remains the source of identity. The work involves deciding which attributes come from the directory, which come from Keycloak token claims, and how existing accounts are matched so that users do not end up with duplicate Nextcloud accounts. You will need directory read access, a test group, and a decision on what happens to accounts disabled in the directory. Confirm which directory is authoritative before the scope is signed.

How many Nextcloud instances change the effort for SSO?

Every Nextcloud instance needs its own client configuration, redirect URIs, mapper checks and login tests, so the effort grows with the count. Instances that share a Keycloak realm can reuse groups and mappers, which keeps the work smaller. Instances in different environments, such as a test copy and a production copy, each need verification. Any clustered or load-balanced setup needs its own review of callback URLs and session behavior. Ask for: the number of instances, their hostnames, which environments they serve, and whether they run the same major version. Nextcloud upgrades move one major version at a time, so instances on different versions need separate upgrade planning before SSO changes are made.

How does the Keycloak deployment model affect an SSO project?

The deployment model decides what must be built and tested before the Nextcloud work can start. A single-node test server, a clustered deployment on virtual machines, and an Operator-managed Kubernetes install each need different database, TLS, reverse proxy and admin hostname settings. Keycloak's production guide calls for TLS on all communication, a reverse proxy with path restrictions, and a separate hostname or context path for the admin console. High availability adds a synchronously replicated database and a choice among the documented architectures. The recommended Operator install path is Operator Lifecycle Manager, and the Operator documentation strongly recommends manual approval for operator updates. Confirm your model before the scope is written.

How much testing does a Keycloak and Nextcloud SSO integration need?

The amount depends on how many login paths, user types and failure cases the scope covers. At minimum, testing should cover first login for a new user, login for an existing directory user if soft provisioning is in scope, group-to-role mapping for each group, a user who is removed or disabled upstream, and backchannel logout for an active session. Bearer token validation for API or client access needs its own test cases if it is in scope. Ask for a written test plan with pass criteria, the test accounts you will provide, and who signs off each result. Plan to run the full test set in a staging copy before any production change.

What must our team provide before a partner starts the work?

Three inputs are needed from your side: directory access, named administrators and sign-off on group mappings. Directory access means a service account or read path to LDAP or Active Directory covering the attributes and groups the scope names. You also need a named Keycloak admin contact who can change realms and clients, and a named Nextcloud admin contact who can change app settings and run upgrades. Group mappings should be approved in writing, since they decide which Nextcloud permissions each group receives. Also provide a test user set, a DNS and TLS certificate plan for both services, and an agreed change window. Missing inputs can delay the work, so list them in the written scope.

Can our own team build this Keycloak and Nextcloud SSO setup?

Yes, if your team has the skills. The work needs working knowledge of Keycloak realms, clients, mappers and user federation, Nextcloud administration including the user_oidc and LDAP apps, and enough TLS and reverse proxy knowledge to validate redirects and logout. Your team can use the Keycloak and Nextcloud documentation as the reference for each step. Partner help is most useful when you want a written scope, fixed deliverables and an independent check of configuration and tests. DeployOpen works from a written scope, and no price is published, so a quote follows from the scope you agree. Ask for a scoping conversation to see which questions your team should answer first.

Are Nextcloud Enterprise tiers required for this integration?

The integration described here is built on the open source Nextcloud server, and the scope does not assume an Enterprise subscription. Enterprise tiers differ in maintenance length, support hours and clustered instance support, and those differences matter if you need vendor support for the SSO setup. Check Nextcloud's pricing page for current Enterprise tier details, and confirm with Nextcloud which features your planned deployment needs. Support terms are a separate purchase from implementation work. DeployOpen is not a Nextcloud reseller, so any subscription is bought from Nextcloud or its channel, and the implementation scope is quoted separately.

How DeployOpen scopes, builds and supports Keycloak and Nextcloud SSO

DeployOpen is a Chainscore Labs company that plans, implements, integrates, hardens, documents and supports self-hosted open-source platforms in infrastructure you control. For Keycloak and Nextcloud SSO, the work runs inside your own cloud accounts, data centers or air-gapped networks, with the written scope agreed before the build starts.

How we scope

  • The written scope names the Keycloak realm, the Nextcloud instance and the user_oidc app version in use.
  • It records which token claims carry user identity and group membership, and which group maps to which Nextcloud role.
  • Engagements are fixed-scope, and ongoing support is available as a retainer after handover.

How we build

  • Configure the Keycloak client, redirect URIs and token claims, then test sign-in against a staging Nextcloud first.
  • Set up user_oidc provisioning from token claims and, where LDAP users already exist, soft provisioning for those accounts.
  • Validate bearer tokens for API access and test backchannel logout across both systems before production cutover.

How we hand over

  • A written runbook covering client settings, claim mappings, group-to-role rules and the settings each one depends on.
  • Test records for sign-in, group-based provisioning, token validation and logout, with steps your team can repeat.
  • Upgrade notes for both products, including Nextcloud's one-major-version-at-a-time rule and user_oidc compatibility checks.

How we support

  • Retainer options for watching Keycloak metrics, applying patch releases and reviewing Nextcloud maintenance releases.
  • Review of Keycloak 26.8 upgrade items, including backchannel logout token signature validation, before each change window.
  • Scheduled checks after each Nextcloud major release, since each major version receives one year of maintenance releases.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.