Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Multiple users with same emails and username can be created. #80

Closed
dpakach opened this issue Aug 5, 2020 · 1 comment
Closed

Multiple users with same emails and username can be created. #80

dpakach opened this issue Aug 5, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@dpakach
Copy link
Contributor

dpakach commented Aug 5, 2020

Steps to reproduce

  1. Run ocis server
  2. Create a user with curl
❯ curl -X POST https://localhost:9200/ocs/v2.php/cloud/users -u admin:admin -d password=pass -d email=hello@example.org -d username=hellouser -k | xmllint --format -

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   357  100   301  100    56  17705   3294 --:--:-- --:--:-- --:--:-- 21000
<?xml version="1.0" encoding="UTF-8"?>
<ocs>
  <meta>
    <status>ok</status>
    <statuscode>200</statuscode>
    <message>OK</message>
  </meta>
  <data>
    <enabled>true</enabled>
    <id>9846f5ec-fb00-40b7-aafb-57764ab7bd29</id>
    <username>hellouser</username>
    <displayname/>
    <email>hello@example.org</email>
  </data>
</ocs>
  1. Create the same user again with same email and username
❯ curl -X POST https://localhost:9200/ocs/v2.php/cloud/users -u admin:admin -d password=pass -d email=hello@example.org -d username=hellouser -k | xmllint --format -

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   357  100   301  100    56   2370    440 --:--:-- --:--:-- --:--:--  2811
<?xml version="1.0" encoding="UTF-8"?>
<ocs>
  <meta>
    <status>ok</status>
    <statuscode>200</statuscode>
    <message>OK</message>
  </meta>
  <data>
    <enabled>true</enabled>
    <id>5ca0f947-5d3c-4ec2-83f2-a9d99f2f101b</id>
    <username>hellouser</username>
    <displayname/>
    <email>hello@example.org</email>
  </data>

Expected behavior

The user should not be created and the response should return error message

Actual behavior

both users are created but when trying to log in with phoenix, we get error in the server with log

ocis          | 2020-08-05T07:45:33.925180642Z 2020-08-05T07:45:33Z ERR IdentifierIdentityManager: fetch failed to get user from userID error="ldap identifier backend get user error: user does not exist or too many entries returned" service=konnectd
ocis          | 2020-08-05T07:45:33.925301752Z 2020-08-05T07:45:33Z ERR identity manager fetch failed error="IdentifierIdentityManager: identifier error" service=konnectd
ocis          | 2020-08-05T07:45:33.925360848Z 2020-08-05T07:45:33Z DBG userinfo request user not found service=konnectd sub=AOZIJvkWz91iYDCr-t6O_GOpZeEFiX-iBdWK3UCXGaFBli8wEruIIj4vvU1kjxd9hwUCt0NXrCBU0zpAuTepDQ@konnect
ocis          | 2020-08-05T07:45:33.925469282Z 2020-08-05T07:45:33Z DBG  bytes=31 duration=74.259117 method=GET path=/konnect/v1/userinfo proto=HTTP/1.1 request=401b2c55-9c7a-43c6-b95a-ef46ab9d7674 service=konnectd status=404

@dpakach dpakach added the bug Something isn't working label Aug 5, 2020
@kulmann
Copy link
Member

kulmann commented Oct 27, 2020

Fixed with owncloud/ocis#709

@kulmann kulmann closed this as completed Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants