nextcloud / nextcloud/user_oidc

Login from apps fails with unique IDs disabled

Open
#690 3 comments 0 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

Steps to reproduce
  1. Setup Keycloak with a custom user storage plugin
  2. Setup a new Nextcloud instance and install user_oidc
  3. Create a confidential client for Nextcloud in Keycloak
  4. Configure Keycloak as OIDC provider in Nextcloud
  5. Disable the Use unique user id option
  6. Try to sign in the Nextcloud app on Android, iOS or Windows
Expected behavior

After granting permission to the app, the web view should close and the Nextcloud app should be authenticated.

Actual behavior

After granting permission to the app, an error 401 Unauthorized appears and authentication fails. The server log shows an error Impossible to decode OIDC token:Wrong number of segments from user_oidc and a warning Login failed: 'f' (Remote IP: '***.***.***.***') from core.

Additional context

I suspect Nextcloud to have problems with user IDs that contain a colon (:). For custom user storage providers, Keycloak generates IDs in the format f:<provider uuid>:<original user id>, e.g., f:d859e431-a45f-4474-8877-fbdfadc31d15:531. If I enable the option Use unique user id which does not include colons (:) in the final user ID, user_oidc works perfectly.

System information

Nextcloud Hub 6 (27.1.2) from docker.io/library/nextcloud:27-apache
user_oidc v1.3.3 from official Apps
Keycloak 22.0.3
User Storage Provider: canchanchara/keycloak-churchtools-storage-provider 0.0.5-alpha

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

Reproduce the Android, iOS, or Windows app login flow with Keycloak configured without the “Use unique user id” option, then inspect the user_oidc token-decoding error and the core login warning described in the report. Done means authentication succeeds after permission is granted without the 401 Unauthorized response, including user IDs containing colons.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.