# Basic Auth: Consumers with same username

**URL:** <https://discuss.konghq.com/t/basic-auth-consumers-with-same-username/2763>\
**Category:** General\
**Created:** [February 6, 2019, 5:47am UTC](https://discuss.konghq.com/t/basic-auth-consumers-with-same-username/2763 "2019-02-06T05:47:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharmmoh1983](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sharmmoh1983](https://discuss.konghq.com/u/sharmmoh1983)\
**Post date:** [February 6, 2019, 5:47am UTC](https://discuss.konghq.com/t/basic-auth-consumers-with-same-username/2763/1 "2019-02-06T05:47:49Z")

</div>

Hi

I have a usecase where there are two consumers with same username but I cant configure it using basic auth plugin as username has to be unique  
Is there any way to handle such scenario?

curl -d “username=user123&custom\_id=SOME\_CUSTOM\_ID” [http://localhost:8001/consumers/](http://localhost:8001/consumers/)

curl -X POST [http://localhost:8001/consumers/user123/basic-auth](http://localhost:8001/consumers/user123/basic-auth) --data “username=Aladdin” --data “password=OpenSesame”

curl -d “username=user1234&custom\_id=SOME\_CUSTOM\_ID1” [http://localhost:8001/consumers/](http://localhost:8001/consumers/)

curl -X POST [http://localhost:8001/consumers/user1234/basic-auth](http://localhost:8001/consumers/user1234/basic-auth) --data “username=Aladdin” --data “password=OpenSesame”

{“message”:“UNIQUE violation detected on ‘{username=“Aladdin”}’”,“name”:“unique constraint violation”,“fields”:{“username”:“Aladdin”},“code”:5}

Why there is violation when I am creating same username in other different consumer?  
Does Kong does not not support same username with different consumers ?

---

<div class="post-metadata">

**Author:** ![thibaultcha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/thibaultcha/32/340_2.png) [@thibaultcha](https://discuss.konghq.com/u/thibaultcha)\
**Post date:** [February 6, 2019, 3:56pm UTC](https://discuss.konghq.com/t/basic-auth-consumers-with-same-username/2763/2 "2019-02-06T15:56:53Z")

</div>

Hi,

Please do not cross post between this forum and GitHub issues ([https://github.com/Kong/kong/issues/4282](https://github.com/Kong/kong/issues/4282)). This is duplicating work for us and someone is already helping you on your other post.

Thanks.

---

<div class="post-metadata">

**Author:** ![sharmmoh1983](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sharmmoh1983](https://discuss.konghq.com/u/sharmmoh1983)\
**Post date:** [February 6, 2019, 7:08pm UTC](https://discuss.konghq.com/t/basic-auth-consumers-with-same-username/2763/3 "2019-02-06T19:08:25Z")

</div>

Hi  
Sorry for the trouble, I posted it out of confusion related to the category of the issue
