# Missing authentication token for REST error

**URL:** https://discuss.elastic.co/t/missing-authentication-token-for-rest-error/142291
**Category:** Elasticsearch
**Tags:** elastic-stack-security, elastic-stack-alerting
**Created:** [July 31, 2018, 7:01am UTC](https://discuss.elastic.co/t/missing-authentication-token-for-rest-error/142291 "2018-07-31T07:01:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Miho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miho/32/33669_2.png) [@Miho](https://discuss.elastic.co/u/Miho)
#### Post date: [July 31, 2018, 7:01am UTC](https://discuss.elastic.co/t/missing-authentication-token-for-rest-error/142291/1 "2018-07-31T07:01:15Z")

</div>

Hello! I'm getting a missing authentication error and was wondering if anyone can help me.  
I'm using version 6.1.1

My code without credentials:

> ```
> PUT _xpack/watcher/watch/cluster_yellow3
> {
> "trigger": {
> "schedule": {
> "interval": "10s"
> }
> },
> "input": {
> "http": {
> "request": {
> "scheme": "http",
> "host": "localhost",
> "port": 9200,
> "method": "GET",
> "path": "/_cluster/health",
> "params": {},
> "headers": {}
> }
> }
> },
> "condition": {
> "compare": {
> "ctx.payload.status": {
> "eq": "yellow"
> }
> }
> },
> "actions": {
> "notify_pager" : {
> "webhook" : {
> "method" : "GET",
> "host" : "ip",
> "port" : 8030,
> "path" : "/TSSparam.do"
> }
> }
> }
> }
> 
> ```

Error code (result of my simulation):

```
"error": {
  "root_cause": [
    {
      "type": "security_exception",
      "reason": "missing authentication token for REST request [/_cluster/health?]",
      "header": {
    "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
      }
    }
  ],

```

---

<div class="post-metadata">

### Author: ![Albert\_Zaharovits](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/albert_zaharovits/32/24390_2.png) [@Albert\_Zaharovits](https://discuss.elastic.co/u/Albert_Zaharovits)
#### Post date: [August 6, 2018, 6:26am UTC](https://discuss.elastic.co/t/missing-authentication-token-for-rest-error/142291/2 "2018-08-06T06:26:20Z")

</div>

Hello @Miho,

Your `/_cluster/health` HTTP query is missing authn info. This [here](https://discuss.elastic.co/t/shield-blocking-watcher-to-query-in-elasticsearch/40028/2) is an old answer about the same error.

---

<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: [September 3, 2018, 6:26am UTC](https://discuss.elastic.co/t/missing-authentication-token-for-rest-error/142291/3 "2018-09-03T06:26:28Z")

</div>

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