# Kibana with SAML : Redirect url for non-authenticated users

**URL:** https://discuss.elastic.co/t/kibana-with-saml-redirect-url-for-non-authenticated-users/174949
**Category:** Kibana
**Created:** [April 2, 2019, 8:58am UTC](https://discuss.elastic.co/t/kibana-with-saml-redirect-url-for-non-authenticated-users/174949 "2019-04-02T08:58:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Bilandak](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Bilandak](https://discuss.elastic.co/u/Bilandak)
#### Post date: [April 2, 2019, 8:58am UTC](https://discuss.elastic.co/t/kibana-with-saml-redirect-url-for-non-authenticated-users/174949/1 "2019-04-02T08:58:54Z")

</div>

Hello everyone,  
I just activated SAML on Kibana with SSL on all components on a test environment, everything is fine.  
I connected this Kibana with the Google SP.  
And it works very fine !  
I just have a question. My users are used to connect to Kibana with an URL like [http://myurl/kibana/app/kibana](http://myurl/kibana/app/kibana) (on the actual Kibana on production, without SAML).  
But right now, with my kibana on a test environment (with SAML), if I'm logged in Google but I don't use the Google App button that redirects me to the Google SP (and then to the kibana) and i use the URL [https://myurl/kibana/app/kibana](https://myurl/kibana/app/kibana), i've got an error like :  
{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}

If i'm logged in Google, use the Kibana button in the Google app, close the Kibana tab then goes to [https://myurl/kibana/app/kibana](https://myurl/kibana/app/kibana), everything is fine. I'm authenticated.

My question is : Is there any way that if a user doesn't use the Google app of my Kibana and goes directly to [https://myurl/kibana/app/kibana](https://myurl/kibana/app/kibana) (even if he's authenticated on Google), he's automatically redirected to the Google SP, and then to the Kibana app with its functionnal SAML account ?

I hope it's clear enough, i searched a lot if a topic was already open about that but i didn't find anything.  
Thanks for your help !

---

<div class="post-metadata">

### Author: ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)
#### Post date: [April 2, 2019, 6:35pm UTC](https://discuss.elastic.co/t/kibana-with-saml-redirect-url-for-non-authenticated-users/174949/2 "2019-04-02T18:35:27Z")

</div>

You should definitely not be getting an internal server error. Can you please provide the Kibana logs during that time?

If you attempt to access Kibana and you are un-authenticated you should be redirected to the provider. Seeing as your hitting an exception, I think something might not be configured correctly.

---

<div class="post-metadata">

### Author: ![Bilandak](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Bilandak](https://discuss.elastic.co/u/Bilandak)
#### Post date: [April 3, 2019, 7:57am UTC](https://discuss.elastic.co/t/kibana-with-saml-redirect-url-for-non-authenticated-users/174949/3 "2019-04-03T07:57:59Z")

</div>

Thanks a lot for your help, much appreciated.

Here's my elasticsearch.log when i try to loggin without being already logged in :

> **[\[2019-04-03T09:43:45,481\]\[WARN \]\[r.suppressed \] \[Rrw3ePd\] path:...](https://pastebin.com/F3zXtYXw)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

(Couldn't paste it directly here because too many characters)

Here's my elasticsearch.yml :

> path.data: /var/lib/elasticsearch  
> path.logs: /var/log/elasticsearch  
> network.host: 10.1.50.17  
> xpack.security.enabled: true  
> xpack.security.transport.ssl.enabled: true  
> xpack.security.transport.ssl.verification\_mode: certificate  
> xpack.security.transport.ssl.key: /etc/elasticsearch/10.1.50.17/10.1.50.17.key  
> xpack.security.transport.ssl.certificate: /etc/elasticsearch/10.1.50.17/10.1.50.17.crt  
> xpack.security.transport.ssl.certificate\_authorities: ["/etc/elasticsearch/ca/ca.crt"]  
> xpack.security.http.ssl.enabled: true  
> xpack.security.http.ssl.key: /etc/elasticsearch/10.1.50.17/10.1.50.17.key  
> xpack.security.http.ssl.certificate: /etc/elasticsearch/10.1.50.17/10.1.50.17.crt  
> xpack.security.http.ssl.certificate\_authorities: ["/etc/elasticsearch/ca/ca.crt"]  
> xpack.security.authc.token.enabled: true  
> xpack.security.authc.realms.saml1:  
> type: saml  
> order: 2  
> idp.metadata.path: /etc/elasticsearch/mymetadatafile.xml  
> idp.entity\_id: "[https://accounts.google.com/o/saml2?idpid=](https://accounts.google.com/o/saml2?idpid=)"  
> sp.entity\_id: "[https://myurl/kibana](https://myurl/kibana)"  
> sp.acs: " [https://myurl/kibana/api/security/v1/saml](https://myurl/kibana/api/security/v1/saml)"  
> sp.logout: "[https://myurl/kibana/logout](https://myurl/kibana/logout)"  
> attributes.principal: "nameid:persistent"

---

<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 1, 2019, 7:58am UTC](https://discuss.elastic.co/t/kibana-with-saml-redirect-url-for-non-authenticated-users/174949/4 "2019-05-01T07:58:03Z")

</div>

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