nextcloud / nextcloud/user_oidc
Login from apps fails with unique IDs disabled
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 181
- Forks
- 60
- Avg merge
- 7h 34m
- Merged PRs (30d)
- 26
Description
Steps to reproduce
- Setup Keycloak with a custom user storage plugin
- Setup a new Nextcloud instance and install user_oidc
- Create a confidential client for Nextcloud in Keycloak
- Configure Keycloak as OIDC provider in Nextcloud
- Disable the Use unique user id option
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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