user_oidc icon indicating copy to clipboard operation
user_oidc copied to clipboard

[Bug]: The searchDisplayName function returns a duplicate user_oidc

Open zak39 opened this issue 2 years ago • 0 comments

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.

:information_source: 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.

zak39 avatar Aug 14 '23 14:08 zak39