# Heartbeat and custom authentication

**URL:** <https://discuss.elastic.co/t/heartbeat-and-custom-authentication/286345>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [October 11, 2021, 8:22am UTC](https://discuss.elastic.co/t/heartbeat-and-custom-authentication/286345 "2021-10-11T08:22:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TommasoMoroni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tommasomoroni/32/95672_2.png) [@TommasoMoroni](https://discuss.elastic.co/u/TommasoMoroni)\
**Post date:** [October 11, 2021, 8:22am UTC](https://discuss.elastic.co/t/heartbeat-and-custom-authentication/286345/1 "2021-10-11T08:22:35Z")

</div>

Hi,

I would like to configure Heartbeat in order to sample an **authenticated** http endpoint.  
This endpoint is authenticated with a JWT token, which I have to obtain with another call with basic auth.

Is it possible to implement a custom authentication "script" or "module" in Heartbeat, in order to do a custom authentication like the one I described?

Thanks,  
Tommaso

---

<div class="post-metadata">

**Author:** ![PaulB-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paulb-elastic/32/78691_2.png) [@PaulB-Elastic](https://discuss.elastic.co/u/PaulB-Elastic)\
**Post date:** [October 11, 2021, 6:00pm UTC](https://discuss.elastic.co/t/heartbeat-and-custom-authentication/286345/2 "2021-10-11T18:00:48Z")

</div>

Hi Tommaso,

We don’t currently support this in Heartbeat today.

You could create a Synthetics user journey to write a multi step script to get the response from the first step to use in the request on the second step, but this does include the overhead of running a full browser (even if you just end up implementing a lightweight HTTP request in your user journey script).

We have a stub issue [Multi Step API Journeys · Issue #137 · elastic/synthetics · GitHub](https://github.com/elastic/synthetics/issues/137) to cover this kind of use case.

---

<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:** [November 8, 2021, 8:01pm UTC](https://discuss.elastic.co/t/heartbeat-and-custom-authentication/286345/3 "2021-11-08T20:01:39Z")

</div>

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