# Custom Plugin: Grab user context

**URL:** <https://discuss.elastic.co/t/custom-plugin-grab-user-context/302949>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [April 21, 2022, 5:33pm UTC](https://discuss.elastic.co/t/custom-plugin-grab-user-context/302949 "2022-04-21T17:33:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gustavo\_Llermaly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gustavo_llermaly/32/92019_2.png) [@Gustavo\_Llermaly](https://discuss.elastic.co/u/Gustavo_Llermaly)\
**Post date:** [April 21, 2022, 5:33pm UTC](https://discuss.elastic.co/t/custom-plugin-grab-user-context/302949/1 "2022-04-21T17:33:28Z")

</div>

Hello there, I need to build an action that sends to a custom API user context information like username and user roles. Is there a service that provides this data like the one that provides search state?

thanks!

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [April 21, 2022, 6:02pm UTC](https://discuss.elastic.co/t/custom-plugin-grab-user-context/302949/2 "2022-04-21T18:02:19Z")

</div>

You can use http plugin and call the API `/internal/security/me` to get the current user informations. Something like this `await http.get('/internal/security/me')`

---

<div class="post-metadata">

**Author:** ![Gustavo\_Llermaly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gustavo_llermaly/32/92019_2.png) [@Gustavo\_Llermaly](https://discuss.elastic.co/u/Gustavo_Llermaly)\
**Post date:** [April 21, 2022, 6:23pm UTC](https://discuss.elastic.co/t/custom-plugin-grab-user-context/302949/3 "2022-04-21T18:23:30Z")

</div>

Awesome, thankyou!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 19, 2022, 6:24pm UTC](https://discuss.elastic.co/t/custom-plugin-grab-user-context/302949/4 "2022-05-19T18:24:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
