# Monitor urls with Windows Authentication

**URL:** https://discuss.elastic.co/t/monitor-urls-with-windows-authentication/304337
**Category:** Beats
**Tags:** heartbeat
**Created:** [May 10, 2022, 11:15am UTC](https://discuss.elastic.co/t/monitor-urls-with-windows-authentication/304337 "2022-05-10T11:15:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aviral\_srivastava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aviral_srivastava/32/98018_2.png) [@aviral\_srivastava](https://discuss.elastic.co/u/aviral_srivastava)
#### Post date: [May 10, 2022, 11:15am UTC](https://discuss.elastic.co/t/monitor-urls-with-windows-authentication/304337/1 "2022-05-10T11:15:40Z")

</div>

Hi,

I am using heartbeat 6.4.0  
I am trying to monitor an https url, below is my configuration:

```auto
heartbeat.monitors:
- type: http
  urls:
    - https://myurl.company.com/
  schedule: '@every 5m'
  username: user
  password: pass

```

In the kibana, I can see I am getting monitor.status as down since error.message is 401 Unauthorized

Above url asks for username and password after I load it in the browser. But the username and password option is not working or may be I am not configuring it correctly.

Can anyone guide here?

---

<div class="post-metadata">

### Author: ![abdulz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulz/32/97601_2.png) [@abdulz](https://discuss.elastic.co/u/abdulz)
#### Post date: [May 10, 2022, 12:03pm UTC](https://discuss.elastic.co/t/monitor-urls-with-windows-authentication/304337/2 "2022-05-10T12:03:05Z")

</div>

Hi @aviral_srivastava, can you cURL the url with the creds and check if they work there?

---

<div class="post-metadata">

### Author: ![aviral\_srivastava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aviral_srivastava/32/98018_2.png) [@aviral\_srivastava](https://discuss.elastic.co/u/aviral_srivastava)
#### Post date: [May 10, 2022, 12:36pm UTC](https://discuss.elastic.co/t/monitor-urls-with-windows-authentication/304337/3 "2022-05-10T12:36:57Z")

</div>

I curled the url and this is what I got.

```auto
curl --user "user:pass" https://myurl.company.com/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>401 - Unauthorized: Access is denied due to invalid credentials.</h2>
  <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>
 </fieldset></div>
</div>
</body>
</html>

```

Also, I made one mistake, it is windows Authentication not basic Authentication.

---

<div class="post-metadata">

### Author: ![abdulz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulz/32/97601_2.png) [@abdulz](https://discuss.elastic.co/u/abdulz)
#### Post date: [May 10, 2022, 2:40pm UTC](https://discuss.elastic.co/t/monitor-urls-with-windows-authentication/304337/4 "2022-05-10T14:40:41Z")

</div>

We currently don't support NTLM authentication in heartbeat.

There have been few requests to support NTLM and other enterprise auths but not enough to include the feature request in the roadmap. A similar discussion can be found [here](https://github.com/elastic/beats/issues/22207).

If it's possible to upgrade the stack to 7.17 or better 8.2, a browser monitor (which uses Elastic Synthetics Agent) could be used to get through such authentication by writing a simple javascript. Please [see](https://www.elastic.co/guide/en/beats/heartbeat/8.2/monitor-browser-options.html).

Also worth reading the [blog post](https://www.elastic.co/blog/why-and-how-replace-end-to-end-tests-synthetic-monitors) on synthetics monitoring.

---

<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: [June 7, 2022, 4:40pm UTC](https://discuss.elastic.co/t/monitor-urls-with-windows-authentication/304337/5 "2022-06-07T16:40:54Z")

</div>

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