# Kibana authentication fails

**URL:** <https://discuss.elastic.co/t/kibana-authentication-fails/98905>\
**Category:** Kibana\
**Created:** [August 30, 2017, 6:30pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905 "2017-08-30T18:30:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![parth126](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@parth126](https://discuss.elastic.co/u/parth126)\
**Post date:** [August 30, 2017, 6:30pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/1 "2017-08-30T18:30:04Z")

</div>

I setup two users on kibana and gave them necessary permission via user roles.  
It was working fine until kibana suddenly crashed. On restarting kibana, I am unable to use any users that I created previously. It returns login error.

The same users work fine with elasticsearch via a python api.

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [August 30, 2017, 6:39pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/2 "2017-08-30T18:39:33Z")

</div>

Anything in the kibana logs?

---

<div class="post-metadata">

**Author:** ![parth126](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@parth126](https://discuss.elastic.co/u/parth126)\
**Post date:** [August 30, 2017, 6:50pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/3 "2017-08-30T18:50:45Z")

</div>

I was dumb enough to print them on stdout and not save. So I have the logs only after I restarted kibana. Nothing useful there.

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [August 30, 2017, 6:56pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/4 "2017-08-30T18:56:11Z")

</div>

As authentication is done at ES you might want to check that while doing a login from kibana. Without logs I cannot help (and I am guessing none can)

---

<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 30, 2017, 9:37pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/5 "2017-08-30T21:37:32Z")

</div>

Are you using X-Pack?

---

<div class="post-metadata">

**Author:** ![parth126](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@parth126](https://discuss.elastic.co/u/parth126)\
**Post date:** [September 1, 2017, 2:23pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/6 "2017-09-01T14:23:15Z")

</div>

Yes I am using X-Pack for this. Sorry I should have mentioned this in the original post.

---

<div class="post-metadata">

**Author:** ![parth126](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@parth126](https://discuss.elastic.co/u/parth126)\
**Post date:** [September 1, 2017, 2:39pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/7 "2017-09-01T14:39:39Z")

</div>

log [14:36:05.869] [info][status][plugin:ml@5.5.1] Status changed from red to green - Ready  
log [14:36:05.901] [error][status][plugin:xpack\_main@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.902] [error][status][plugin:graph@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.903] [error][status][plugin:reporting@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.904] [error][status][plugin:security@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.905] [error][status][plugin:searchprofiler@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.905] [error][status][plugin:ml@5.5.1] Status changed from green to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.906] [error][status][plugin:tilemap@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.907] [error][status][plugin:watcher@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:05.908] [error][status][plugin:elasticsearch@5.5.1] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [14:36:08.489] [info][status][plugin:elasticsearch@5.5.1] Status changed from red to green - Kibana index ready  
log [14:36:08.490] [info][status][ui settings] Status changed from red to green - Ready  
log [14:36:08.511] [info][license][xpack] Imported license information from Elasticsearch for [data] cluster: mode: trial | status: active | expiry date: 2017-09-28T07:18:31+00:00  
log [14:36:08.534] [info][status][plugin:xpack\_main@5.5.1] Status changed from red to green - Ready  
log [14:36:08.535] [info][status][plugin:graph@5.5.1] Status changed from red to green - Ready  
log [14:36:08.537] [info][status][plugin:reporting@5.5.1] Status changed from red to green - Ready  
log [14:36:08.538] [info][status][plugin:security@5.5.1] Status changed from red to green - Ready  
log [14:36:08.539] [info][status][plugin:searchprofiler@5.5.1] Status changed from red to green - Ready  
log [14:36:08.540] [info][status][plugin:ml@5.5.1] Status changed from red to green - Ready  
log [14:36:08.541] [info][status][plugin:tilemap@5.5.1] Status changed from red to green - Ready  
log [14:36:08.542] [info][status][plugin:watcher@5.5.1] Status changed from red to green - Ready  
log [14:36:08.565] [info][license][xpack] Imported license information from Elasticsearch for [monitoring] cluster: mode: trial | status: active | expiry date: 2017-09-28T07:18:31+00:00  
log [14:36:08.568] [info][status][plugin:monitoring@5.5.1] Status changed from green to yellow - Waiting for Monitoring Health Check  
log [14:36:08.770] [info][status][plugin:monitoring@5.5.1] Status changed from yellow to green - Ready

This is the kibana log, after I restarted kibana and elasticsearch

---

<div class="post-metadata">

**Author:** ![karanshah](https://avatars.discourse-cdn.com/v4/letter/k/3be4f8/32.png) [@karanshah](https://discuss.elastic.co/u/karanshah)\
**Post date:** [September 1, 2017, 3:56pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/8 "2017-09-01T15:56:13Z")

</div>

@parth126 can you try checking the roles of the users directly using curl on elastic search.

curl -XGET [http://host](http://host):port/.security/user/USERNAME?pretty

Pass the username password and cert required in curl command.

Check if the user is found,enabled and has kibana\_user role.

---

<div class="post-metadata">

**Author:** ![parth126](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@parth126](https://discuss.elastic.co/u/parth126)\
**Post date:** [September 2, 2017, 6:44pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/9 "2017-09-02T18:44:45Z")

</div>

Hi @karanshah

That seems to clarify things a bit. None of the users are found.  
But surprisingly the users still work when communicating with elasticsearch.

curl -XGET -u elastic 'hostname:port/.security/user/elastic?pretty'

This works fine with the username 'elastic' (default superuser)  
But it is unable to find the user 'elastic'

Response:

```
{
 "_index" : ".security",
"_type" : "user",
"_id" : "elastic",
"found" : false
 }

```

What am I doing wrong?

Update:

Seems like this command lists only the new users and roles that I defined and not the default users ('elastic' and 'kibana').

So I tried in on the new user (my-company-admin), and here is the result:

```
{
  "_index" : ".security",
  "_type" : "user",
  "_id" : "my-company-admin",
  "_version" : 1,
  "found" : true,
  "_source" : {
    "username" : "my-company-admin",
    "password" : "some encoded stuff",
    "roles" : [
      "my_company_admin"
    ],
    "full_name" : null,
    "email" : null,
    "metadata" : null,
    "enabled" : true
  }
}

```

Details for the user role (my\_company\_user):

```
{
  "_index" : ".security",
  "_type" : "role",
  "_id" : "my_company_admin",
  "_version" : 1,
  "found" : true,
  "_source" : {
    "cluster" : [],
    "indices" : [
      {
        "names" : [
          "my_company*"
        ],
        "privileges" : [
          "manage",
          "read",
          "index"
        ]
      },
      {
        "names" : [
          ".kibana*"
        ],
        "privileges" : [
          "manage",
          "read",
          "index"
        ]
      }
    ],
    "run_as" : [],
    "metadata" : { }
  }
}
```

---

<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 30, 2017, 6:45pm UTC](https://discuss.elastic.co/t/kibana-authentication-fails/98905/10 "2017-09-30T18:45:12Z")

</div>

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