# How to apply different auth plugin chain for different consumers?

**URL:** <https://discuss.konghq.com/t/how-to-apply-different-auth-plugin-chain-for-different-consumers/2229>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [November 7, 2018, 11:08am UTC](https://discuss.konghq.com/t/how-to-apply-different-auth-plugin-chain-for-different-consumers/2229 "2018-11-07T11:08:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nithinkd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/nithinkd/32/1516_2.png) [@nithinkd](https://discuss.konghq.com/u/nithinkd)\
**Post date:** [November 7, 2018, 11:08am UTC](https://discuss.konghq.com/t/how-to-apply-different-auth-plugin-chain-for-different-consumers/2229/1 "2018-11-07T11:08:43Z")

</div>

hello

is it possible to apply different plugin chain based on consumers?

like one consumer is authenticated with key-auth and Jwt ,but another consumer is authenticated only with key-auth .how can i achieve this?

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [March 21, 2019, 10:35pm UTC](https://discuss.konghq.com/t/how-to-apply-different-auth-plugin-chain-for-different-consumers/2229/2 "2019-03-21T22:35:22Z")

</div>

You can create multiple routes and each route has it’s own authentication plugin enabled.

---

<div class="post-metadata">

**Author:** ![thiraj89](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@thiraj89](https://discuss.konghq.com/u/thiraj89)\
**Post date:** [July 30, 2019, 11:09am UTC](https://discuss.konghq.com/t/how-to-apply-different-auth-plugin-chain-for-different-consumers/2229/3 "2019-07-30T11:09:50Z")

</div>

I have configured two consumer for single routes. Both consumer having different basic auth and key auth information. Here both two key accepting combine request of api key.

## Consumer 1:

Basic Auth: username: user1  
password: pas1  
Key Auth: key1

## Consumer 2:

Basic Auth: username: user2  
password: pas2  
Key Auth: key2

My Api call is accepting with below auth credential. But it should not work because apikey (key2) is holding consumer 2 and basic auth (user1/pas1) holding consumer1.

[www.domain.com/test?apikey=key2](http://www.domain.com/test?apikey=key2)  
Basic Auth: username: user1  
password: pas1

My requirement is below

[www.domain.com/test?apikey=key1](http://www.domain.com/test?apikey=key1)  
Basic Auth: username: user1  
password: pas1

[www.domain.com/test?apikey=key2](http://www.domain.com/test?apikey=key2)  
Basic Auth: username: user2  
password: pas2
