nextcloud / nextcloud/user_oidc

migrate local NextCloud user to OIDC

Open
#565 10 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
181
Forks
60
Avg merge
7h 34m
Merged PRs (30d)
26

Description

It is a common use cases that self-hosted environments grow: in features but also from simple to complex. Hence it is likely that a NextCloud instance is first set up with local user management (by NextCloud natively). Maybe later, an authentication server gets mixed in, and here we are: let's use user_oidc for that.

Question: how can one migrate the local users to the OIDC provider?

With vanilla settings, user_oidc always creates a new user, even if the email of a NextCloud user and user_oidc-provided user match.

What I tried:
Example: my NextCloud user has the username foo. user_oidc is configured like this:
image
I.e. it knows which username the authentication server (Keycloak in my case) uses: username.
Logging in now, doesn't create a new user, but directly fails:

"Failed to provision user"

Would it be possible to merge accounts then?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the user_oidc provisioning flow described in the issue, including the username mapping and the “Failed to provision user” path. Define how an existing local account should be matched or merged with the OIDC identity, then verify that login no longer creates a duplicate user and that existing account data remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.