# SESSION\_EXPIRED while login kibana

**URL:** <https://discuss.elastic.co/t/session-expired-while-login-kibana/147511>\
**Category:** Kibana\
**Created:** [September 6, 2018, 7:23am UTC](https://discuss.elastic.co/t/session-expired-while-login-kibana/147511 "2018-09-06T07:23:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![talon](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@talon](https://discuss.elastic.co/u/talon)\
**Post date:** [September 6, 2018, 7:23am UTC](https://discuss.elastic.co/t/session-expired-while-login-kibana/147511/1 "2018-09-06T07:23:53Z")

</div>

HI  
I faced an issue, when i login the kibana ,after i login , the browser will go to [https://sent2-kibana-qa.dsentience.net/logout?next=%2Fapp%2Fkibana%23%2Fhome%3F\_g%3D()&msg=SESSION\_EXPIRED](https://sent2-kibana-qa.dsentience.net/logout?next=%2Fapp%2Fkibana%23%2Fhome%3F_g%3D()&msg=SESSION_EXPIRED)

Environment of my ELK  
two nodes for kibana, there is a loud balance those two kibabas, and SAML in enable in this environment.

Test  
when i remove one kibana, so the environment only have one kibana, i can login successfully.

here is the configuration in kibana  
server.port: 5601  
server.host: "0.0.0.0"  
xpack.security.public:  
protocol: https  
hostname: [sent2-kibana-qa.dsentience.net](http://sent2-kibana-qa.dsentience.net)  
port: 443  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
elasticsearch.url: "[https://10.8.160.XXX:9200](https://10.8.160.XXX:9200)"  
kibana.index: ".kibana"  
kibana.defaultAppId: "home"  
elasticsearch.username: "elastic"  
elasticsearch.password: "XXXXXXX"  
logging.dest: /var/log/kibana/kibana.log  
server.ssl.enabled: true  
server.ssl.certificate: /etc/kibana/kibana-2/kibana.crt  
server.ssl.key: /etc/kibana/kibana-2/kibana.key  
elasticsearch.ssl.verificationMode: none  
#xpack.license.self\_generated.type: trial  
xpack.security.authProviders: [saml]  
server.xsrf.whitelist: [/api/security/v1/saml]  
xpack.monitoring.elasticsearch.requestHeadersWhitelist: [es-security-runas-user, authorization]

the two nodes' configuration are the same.  
the version of kibana and elastic is version 6.3.1

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [September 7, 2018, 11:17am UTC](https://discuss.elastic.co/t/session-expired-while-login-kibana/147511/2 "2018-09-07T11:17:42Z")

</div>

As I've also mentioned [in other topics you've opened](https://discuss.elastic.co/t/elasticsearch-saml-integration-while-using-http-redirect/139658/29):

> [@Elasticsearch SAML integration while using HTTP-Redirect](https://discuss.elastic.co/t/elasticsearch-saml-integration-while-using-http-redirect/139658/29):
>
> You can easily copy the actual text by using the `</>` buttons.

Please take the time to do this, it makes your post so much easier to consume and that means you have better chances of getting a response.

This is unrelated to your issue, but you only need one  
`elasticsearch.url: "https://10.8.160.XXX:9200"`  
in your configuration.

In order to make sure that SAML Authentication succeeds when using a load balancer in front of Kibana, you need to ensure that:

- Your X Kibana instances need to use the same [`xpack.security.encryptionKey`](https://www.elastic.co/guide/en/kibana/current/using-kibana-with-security.html). This is unrelated to SAML and would be required even if you used basic authentication for Kibana. It is required so that all Kibana instances can verify the authentication cookie that one of them generates after successful authentication, in case the user gets to a different Kibana instance (due to LB configuration) while they have an active session.

- You need to setup your LB with a certain session affinity. The details of how to do that are specific to you LB, but you need to configure it in such a way so that both the

---

<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:** [October 5, 2018, 11:17am UTC](https://discuss.elastic.co/t/session-expired-while-login-kibana/147511/3 "2018-10-05T11:17:42Z")

</div>

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

---

<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:** [October 5, 2018, 11:17am UTC](https://discuss.elastic.co/t/session-expired-while-login-kibana/147511/4 "2018-10-05T11:17:43Z")

</div>



---

<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:** [November 4, 2022, 6:34am UTC](https://discuss.elastic.co/t/session-expired-while-login-kibana/147511/5 "2022-11-04T06:34:18Z")

</div>


