nextcloud / nextcloud/user_oidc

[Bug]: The searchDisplayName function returns a duplicate user_oidc

Open
#665 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi everyone :)

I find an issue on the user_oidc app and the backend system.

When I would like to list users from my API route, I get a duplicate users_oidc.

[
	{
		"uid": "cdupont",
		"display_name": "Christine Dupont",
		"backend_name": "LDAP"
	},
	{
		"uid": "channel",
		"display_name": "Christiane Hannel",
		"backend_name": "LDAP"
	},
	{
		"uid": "company-sso-test-fg11t142-98cb-4931-a2r6-61a28b9f1c32",
		"display_name": "jcfoo Foo",
		"backend_name": "user_oidc"
	},
	{
		"uid": "company-sso-test-fg11t142-98cb-4931-a2r6-61a28b9f1c32",
		"display_name": "jcfoo Foo",
		"backend_name": "user_oidc"
	},
	{
		"uid": "company-sso-test-fg11t142-98cb-4931-a2r6-61a28b9f1c32",
		"display_name": "jcfoo Foo",
		"backend_name": "user_oidc"
	}
]

My route is https://mylocal/index.php/apps/workspace/api/autoComplete/c/16 and the bug seems to be on the searchDisplayName function from OCP\IUserManager. But, I am not sure.

I expected to have this result :

[
	{
		"uid": "cdupont",
		"display_name": "Christine Dupont",
		"backend_name": "LDAP"
	},
	{
		"uid": "channel",
		"display_name": "Christiane Hannel",
		"backend_name": "LDAP"
	},
	{
		"uid": "company-sso-test-fg11t142-98cb-4931-a2r6-61a28b9f1c32",
		"display_name": "jmfoo Foo",
		"backend_name": "user_oidc"
	},
]

To reproduce

  1. Install the groupfolders app, first, then the workspace app.
  2. Following these instructions to configure the workspace app : https://github.com/arawa/workspace/#-configure-groupfolders-for-workspace.
  3. Create a workspace from the workspace app.
  4. With Postman or Insomnia, execute this request https://mylocal/index.php/apps/workspace/api/autoComplete/c/1.

ℹ️ The letter c corresponds to a letter in the uid of an user (example: channel or jcfoo).

  1. Finally, you get the same result as me.

Nextcloud version

I use the Nextcloud 26.

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 inspecting the referenced searchDisplayName call in lib/Service/WorkspaceService.php and trace how the user_oidc backend results are collected for the autocomplete API. Reproduce the request described with Nextcloud 26, then identify where the same user is added repeatedly; done means the response contains each matching user once with the expected fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.