# V 2.4.6 with Shield Authorization Problem

**URL:** <https://discuss.elastic.co/t/v-2-4-6-with-shield-authorization-problem/128729>\
**Category:** Elasticsearch\
**Created:** [April 19, 2018, 2:39pm UTC](https://discuss.elastic.co/t/v-2-4-6-with-shield-authorization-problem/128729 "2018-04-19T14:39:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alchalade](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@alchalade](https://discuss.elastic.co/u/alchalade)\
**Post date:** [April 19, 2018, 2:39pm UTC](https://discuss.elastic.co/t/v-2-4-6-with-shield-authorization-problem/128729/1 "2018-04-19T14:39:35Z")

</div>

Hi together,  
I'm facing a Problem with the authentication. I'm using a search-plugin so I'm strictly bound to Version 2.4.

My Setup:  
Elasticsearch is running in a Docker

After I install shield, I add a user  
`bin/shield/esusers adduser es_admin -p1234689 -r admin`  
when I list the user with `esusers list`, es\_admin is listed.

I make the curl request for testing purpose:

```auto
 curl --user es_admin:12345689 -XGET 'server01.host.com:9200/search?pretty'

```

The result is :

```auto
{
  "error" : {
    "root_cause" : [ {
      "type" : "security_exception",
      "reason" : "unable to authenticate user [es_admin] for REST request [/search?pretty]",
      "header" : {
        "WWW-Authenticate" : "Basic realm=\"shield\" charset=\"UTF-8\""
      }
    } ],
    "type" : "security_exception",
    "reason" : "unable to authenticate user [es_admin] for REST request [/search?pretty]",
    "header" : {
      "WWW-Authenticate" : "Basic realm=\"shield\" charset=\"UTF-8\""
    }
  },
  "status" : 401
}

```

And this is how the elasticsearch.yaml is lookslike

```auto
http.host: 0.0.0.0

#shield.transport.filter.allow: ["x.x.x.x.x"]
#shield.transport.filter.deny: _all

shield:
  authc:
    realms:
      file1:
        type: file
        order: 0

```

What am I doing wrong?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [April 19, 2018, 3:48pm UTC](https://discuss.elastic.co/t/v-2-4-6-with-shield-authorization-problem/128729/2 "2018-04-19T15:48:08Z")

</div>

> [@alchalade](#):
>
> curl --user es\_admin:12345689 -XGET '[server01.host.com:9200/search?pretty](http://server01.host.com:9200/search?pretty)'

Fancy trying with `/_search?pretty`

ref: [The Search API | Elasticsearch Guide [2.4] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/_the_search_api.html)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 19, 2018, 8:46pm UTC](https://discuss.elastic.co/t/v-2-4-6-with-shield-authorization-problem/128729/3 "2018-04-19T20:46:47Z")

</div>

Also please be aware the 2.X is no longer supported.

---

<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 17, 2018, 8:46pm UTC](https://discuss.elastic.co/t/v-2-4-6-with-shield-authorization-problem/128729/4 "2018-05-17T20:46:55Z")

</div>

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