# SAML SSO with WSO2 and Kibana

**URL:** <https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [October 15, 2018, 11:26am UTC](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482 "2018-10-15T11:26:51Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![subhomoy.mukherjee](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@subhomoy.mukherjee](https://discuss.elastic.co/u/subhomoy.mukherjee)\
**Post date:** [October 17, 2018, 2:27pm UTC](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482/21 "2018-10-17T14:27:04Z")

</div>

> [@ikakavas](#):
>
> You need to make sure your user has the necessary permissions to view the dashboard. This is managed by [mapping the user to the appropriate roles](https://www.elastic.co/guide/en/x-pack/current/saml-role-mapping.html) in Elasticsearch.

Thanks for this, now able to login after mapping users to roles.

But noticed one thing that, if after some time I retry to login to my application and try to access the dashboard, I get the same following error as before:

> [@subhomoy.mukherjee](#):
>
> Due to this, I get the below in the logs:
> 
> ```auto
> [2018-10-16T15:50:39,652][WARN][o.e.x.s.a.s.SamlAuthenticator] [hQ9aV9b] The XML Signature of this SAML message cannot be validated. Please verify that the saml realm uses the correct SAMLmetadata file/URL for this Identity Provider
> [2018-10-16T15:50:39,655][WARN][o.e.x.s.a.AuthenticationService] [hQ9aV9b] Authentication to realm saml1 failed - Provided SAML response is not valid for realm saml/saml1 (Caused by ElasticsearchSecurityException[SAML Signature [zmMT/0xpQWinHr+qhdmDMc0rGiw=
> Sui...] could not be validated against []])
> 
> ```

Now, if I re-download the `metadata` file from `WSO2 IS` and reset all the `singlesignon` URLs, save everything and restart the servers, it works again - able to login.  
Do we need to download the metadata file after certain durations or is there some configuration issue? Could you please advise?

---

<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:** [October 17, 2018, 4:38pm UTC](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482/22 "2018-10-17T16:38:01Z")

</div>

There is nothing on the Elasticsearch side that would override the metadata assuming you use

```auto
idp.metadata.path: saml/idp-metadata.xml

```

as you indicated. It looks like something on your side is overwriting that file or your WSO2 IS is changing configuration at some point. Either way there is nothing we could help you with regarding this issue.

---

<div class="post-metadata">

**Author:** ![subhomoy.mukherjee](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@subhomoy.mukherjee](https://discuss.elastic.co/u/subhomoy.mukherjee)\
**Post date:** [October 29, 2018, 1:58pm UTC](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482/23 "2018-10-29T13:58:24Z")

</div>

Hello,

Solved this issue by changing the "Valid Until" field in the metadata.xml file. The SSO works as expected now. Thanks for all the help provided.

---

<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:** [October 29, 2018, 2:14pm UTC](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482/24 "2018-10-29T14:14:07Z")

</div>

> [@subhomoy.mukherjee](#):
>
> Solved this issue by changing the "Valid Until" field in the metadata.xml file. The SSO works as expected now. Thanks for all the help provided.

Good to hear ! Please note that if  
a) If the metadata are prone to change often or have a short validity time and  
b) your IDP is hosting the metdata file at an https URL that can be reached from the Elasticsearch nodes

you can set the the URL in the SAML realm configuration of Elasticsearch as such

```auto
idp.metadata.path: https://youridpserver.com/path/to/idp-metadata.xml

```

and possibly also set

```auto
idp.metadata.http.refresh:

```

to control the frequency at which Elasticsearch is fetching the metadata file from your IDP ( default is 1h ) .

---

<div class="post-metadata">

**Author:** ![subhomoy.mukherjee](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@subhomoy.mukherjee](https://discuss.elastic.co/u/subhomoy.mukherjee)\
**Post date:** [October 30, 2018, 12:37pm UTC](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482/25 "2018-10-30T12:37:12Z")

</div>

> [@ikakavas](#):
>
> you can set the the URL in the SAML realm configuration of Elasticsearch as such
> 
> ```auto
> idp.metadata.path: https://youridpserver.com/path/to/idp-metadata.xml
> 
> ```
> 
> and possibly also set
> 
> ```auto
> idp.metadata.http.refresh:
> 
> ```

This tip definitely helps. Thanks!

---

<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 27, 2018, 12:37pm UTC](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482/26 "2018-11-27T12:37:17Z")

</div>

Closed on November 27, 2018, 12:37pm UTC

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

[Previous page](https://discuss.elastic.co/t/saml-sso-with-wso2-and-kibana/152482.md?page=1)
