# How to perform authentication in kibana?

**URL:** <https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630>\
**Category:** Kibana\
**Created:** [August 29, 2017, 5:58am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630 "2017-08-29T05:58:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [August 29, 2017, 5:58am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/1 "2017-08-29T05:58:43Z")

</div>

Hi team ,

Can X-pack authenticate kibana for multiple users ?

As i am new to Kibana, so need assistance to make authentication possible in kibana.

---

<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:** [August 29, 2017, 8:00am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/2 "2017-08-29T08:00:28Z")

</div>

Yes it can.

What do you need assistance with? Have you read [https://www.elastic.co/guide/en/x-pack/current/xpack-security.html](https://www.elastic.co/guide/en/x-pack/current/xpack-security.html)?

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [August 29, 2017, 10:59am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/3 "2017-08-29T10:59:54Z")

</div>

Thanks for the reply

While going through the link ,i figured out that i need to have LDAP, Active Directory, or PKI .  
but dont't have any idea that how to make them work.

please help me with that.

---

<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:** [August 29, 2017, 10:03pm UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/4 "2017-08-29T22:03:16Z")

</div>

If you don't have any of those then use the native realm, it'll be easiest.

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [August 31, 2017, 1:09pm UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/5 "2017-08-31T13:09:21Z")

</div>

@warkolm Can you help me with how to make it work with native relam.

Have gone through link but i'm not clear about how to make it work.

---

<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:** [August 31, 2017, 11:26pm UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/6 "2017-08-31T23:26:56Z")

</div>

Did you read over [https://www.elastic.co/guide/en/x-pack/current/native-realm.html](https://www.elastic.co/guide/en/x-pack/current/native-realm.html)

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 1, 2017, 6:53am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/7 "2017-09-01T06:53:15Z")

</div>

Yes, gone through the document.

but after i installed X-PACK, i'm not able to see `xpack.security.authc.realms` namespace in `elasticsearch.yml`.

---

<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:** [September 1, 2017, 7:08am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/8 "2017-09-01T07:08:07Z")

</div>

You need to add it 🙂

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 1, 2017, 8:53am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/9 "2017-09-01T08:53:07Z")

</div>

@warkolm Thanks for the reply

I have added `xpack.security.authc.realms`namespace in`elasticsearch.yml.`

But for `Adding User` i'm getting error

i'm using command

```
        curl -XPOST 'localhost:9200/_xpack/security/user/jacknich?pretty' -H 'Content-Type: application/json' -d'
        {
          "password" : "abcd@2017", 
          "roles" : ["admin", "other_role1"], 
          "full_name" : "Abhishek Mohanty", 
          "email" : "", 
          "metadata" : { 
            "intelligence" : 7
          },
          "enabled": true 
        }
        '

```

and i'm getting error

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

---

<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:** [September 1, 2017, 9:23am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/10 "2017-09-01T09:23:52Z")

</div>

Did you pass in the default username and password, assuming you are on 5.X?

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 1, 2017, 9:55am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/11 "2017-09-01T09:55:44Z")

</div>

> [@warkolm](#):
>
> assuming you are on 5.X

Yes

> [@warkolm](#):
>
> Did you pass in the default username and password

No  
How should i pass it ?

and i have used default `xpack.security.authc.realms` namespace

```
xpack:
  security:
    authc:
      realms:
        native1:
          type: native
          order: 0

```

is this correct ?

---

<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:** [September 1, 2017, 9:56am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/12 "2017-09-01T09:56:25Z")

</div>

You need to pass it into the curl command.

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 1, 2017, 11:01am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/13 "2017-09-01T11:01:51Z")

</div>

@warkolm which curl command i need to use ? can you please share me the link that could be useful.

can you give a example for how to define a sample realm in elasticsearch.yml

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 4, 2017, 6:31am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/14 "2017-09-04T06:31:31Z")

</div>

I'm getting `authentication exception` error for every curl command..  
How should i resolve the issue?

---

<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:** [September 4, 2017, 10:10am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/15 "2017-09-04T10:10:43Z")

</div>

If you are getting errors please post the entire command you are calling as well as the entire output.

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 4, 2017, 10:19am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/16 "2017-09-04T10:19:18Z")

</div>

Hi warkolm, thanks for the reply

> [@abhisek](#):
>
> i’m using command
> 
> ```
> curl -XPOST 'localhost:9200/_xpack/security/user/jacknich?pretty' -H 'Content-Type: application/json' -d'
> {
> "password" : "abcd@2017", 
> "roles" : ["admin", "other_role1"], 
> "full_name" : "Abhishek Mohanty", 
> "email" : "", 
> "metadata" : { 
> "intelligence" : 7
> },
> "enabled": true 
> }
> '
> 
> ```
> 
> and i’m getting error
> 
> {  
> "error" : {  
> "root\_cause" : [  
> {  
> "type" : "security\_exception",  
> "reason" : "missing authentication token for REST request [/\_xpack/security/user/jacknich?pretty]",  
> "header" : {  
> "WWW-Authenticate" : "Basic realm="security" charset="UTF-8""  
> }  
> }  
> ],  
> "type" : "security\_exception",  
> "reason" : "missing authentication token for REST request [/\_xpack/security/user/jacknich?pretty]",  
> "header" : {  
> "WWW-Authenticate" : "Basic realm="security" charset="UTF-8""  
> }  
> },  
> "status" : 401  
> }

Getting the same error for another command

```
curl 'localhost:9200/_cat/indices?v'

```

---

<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:** [September 5, 2017, 4:00am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/17 "2017-09-05T04:00:39Z")

</div>

Right, so you need to pass in `-u username:password` to curl, where you replace `user` and `password` with valid users.

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 6, 2017, 6:08am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/18 "2017-09-06T06:08:27Z")

</div>

I'm having a doubt, that i need to install `X-Pack` on `elasticsearch` and `kibana` both or installing X-Pack on only `elasticsearch` will do..?

---

<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:** [September 6, 2017, 6:09am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/19 "2017-09-06T06:09:49Z")

</div>

It needs to be installed on all parts of the stack.

---

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [September 6, 2017, 7:16am UTC](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630/20 "2017-09-06T07:16:02Z")

</div>

Thanks for the answer

But i have `elasticsearch, kibana and logstash` all three installed on the same server .

In that case also i need to installed X-Pack on all the stack.

[Next page](https://discuss.elastic.co/t/how-to-perform-authentication-in-kibana/98630.md?page=2)
