# Creating consumers in Konnect from a plugin

**URL:** <https://discuss.konghq.com/t/creating-consumers-in-konnect-from-a-plugin/12181>\
**Category:** Questions\
**Created:** [December 8, 2023, 4:54pm UTC](https://discuss.konghq.com/t/creating-consumers-in-konnect-from-a-plugin/12181 "2023-12-08T16:54:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fsanchez](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/fsanchez/32/4257_2.png) [@fsanchez](https://discuss.konghq.com/u/fsanchez)\
**Post date:** [December 8, 2023, 4:54pm UTC](https://discuss.konghq.com/t/creating-consumers-in-konnect-from-a-plugin/12181/1 "2023-12-08T16:54:48Z")

</div>

I created a custom plugin to authenticate my users who provide Basic auth with the existing authentication service in my company. Now I want to be able to create a consumer in Kong for the authenticated users.  
My alternative is to have a synchronization process from the existing authentication service to kong to have the users updated every time there is a change.  
Because Kong is not the one who holds the user database, it is easier to handle adding/removing users on-demand depending on the response from my authentication server from the custom plugin.  
Any suggestion here.  
I already have a working prototype that uses the event infrastructure to call the kong konnect consumer api to create a new consumer, and I provision the Kong API key through a vault to make it secure. I still don’t know how to identify my control plane id automatically, but for now it is in the plugin config.  
Any idea is welcomed.  
Thank you very much.
