# Use upstream inside kong custom plugin access function

**URL:** <https://discuss.konghq.com/t/use-upstream-inside-kong-custom-plugin-access-function/2036>\
**Category:** General\
**Created:** [October 5, 2018, 12:12pm UTC](https://discuss.konghq.com/t/use-upstream-inside-kong-custom-plugin-access-function/2036 "2018-10-05T12:12:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prince\_Raheja](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@Prince\_Raheja](https://discuss.konghq.com/u/Prince_Raheja)\
**Post date:** [October 5, 2018, 12:12pm UTC](https://discuss.konghq.com/t/use-upstream-inside-kong-custom-plugin-access-function/2036/1 "2018-10-05T12:12:32Z")

</div>

I am developing a custom plugin for authentication in which I make a rest api call to a service. I want to use one of the existing upstream to make that api call.  
e.g. I have upstream -\> `auth-upstream` with targets `[localhost:9998,localhost:9999]`  
So inside of the plugin I want to call `http://auth-upstream/auth/verify-token` and kong will automatically load balance it or I can get all the targets corresponding to `auth-upstream` and I can use any random target for the api call.
