# OAuth authentication

**URL:** <https://discuss.elastic.co/t/oauth-authentication/262081>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [January 25, 2021, 11:00am UTC](https://discuss.elastic.co/t/oauth-authentication/262081 "2021-01-25T11:00:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atira/32/28699_2.png) [@atira](https://discuss.elastic.co/u/atira)\
**Post date:** [January 25, 2021, 11:00am UTC](https://discuss.elastic.co/t/oauth-authentication/262081/1 "2021-01-25T11:00:10Z")

</div>

Hi,  
Is it somehow possible to use 2-legged OAuth authentication, specifically client\_credentials and password type, with Heartbeat?  
The goal is to request a token by a single request to the oauth server, extract the token from the response and attach it to a header when issuing the request to the resource server (endpoint to be monitored).

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [January 25, 2021, 3:03pm UTC](https://discuss.elastic.co/t/oauth-authentication/262081/2 "2021-01-25T15:03:57Z")

</div>

If you use [synthetic monitoring](https://www.elastic.co/guide/en/observability/master/synthetic-monitoring.html) this should be possible since you have unlimited control over browser automation.

For our lightweight checks we only send a single request, and this isn't possible.

---

<div class="post-metadata">

**Author:** ![atira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atira/32/28699_2.png) [@atira](https://discuss.elastic.co/u/atira)\
**Post date:** [January 26, 2021, 5:49pm UTC](https://discuss.elastic.co/t/oauth-authentication/262081/3 "2021-01-26T17:49:03Z")

</div>

Thank you for the answer.  
Looking forward for such a feature, it would be a nice addition.  
Synthetic monitoring would need a lot of investment to learn it.

---

<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:** [February 23, 2021, 7:49pm UTC](https://discuss.elastic.co/t/oauth-authentication/262081/4 "2021-02-23T19:49:05Z")

</div>

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