# Unable to configure SAML using IDP\_Metadata File

**URL:** <https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479>\
**Category:** Security\
**Created:** [February 13, 2023, 10:05am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479 "2023-02-13T10:05:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmallick19](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dmallick19](https://forum.opensearch.org/u/dmallick19)\
**Post date:** [February 13, 2023, 10:05am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/1 "2023-02-13T10:05:14Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
Opesearch/Dashboards - 2.5.0

**Describe the issue** :  
I have trying to configure SAML auth using IDP file provided by my organization and its been going on since a long time and achieved the success of it. Need your help to fix the issue.

**Configuration** :  
Opensearch SAML Config -

saml\_auth\_domain:  
description: “SAML Auth”  
http\_enabled: true  
transport\_enabled: false  
order: 2  
http\_authenticator:  
type: saml  
challenge: true  
config:  
idp:  
metadata\_file: /usr/share/opensearch/config/idp-elk-r2.xml  
entity\_id: “Dell.UAT.SAML2.0”  
sp:  
entity\_id: “[https://elk-r2.dell.com](https://elk-r2.dell.com)”  
acs: “[https://elk-r2.dell.com/\_plugins/\_security/saml/acs](https://elk-r2.dell.com/_plugins/_security/saml/acs)”  
#logout: “[https://elk-r2.dell.com/\_plugins/\_security/saml/logout](https://elk-r2.dell.com/_plugins/_security/saml/logout)”  
kibana\_url: “[https://elk-r2.dell.com](https://elk-r2.dell.com)”  
subject\_key: UserID  
roles\_key: Role  
exchange\_key: “32alphanumeric”  
authentication\_backend:  
type: noop

Note - I have tried the acs option with both \_opendistro/ & \_plugins, both are not working it seems.

Opensearch Dashboard Config

server.name: xxxxx  
opensearch.hosts: [“[https://xxxxx:9200](https://xxxxx:9200)”, “[https://xxxxxx:9200](https://xxxxxx:9200)”, “[https://xxxxx:9200](https://xxxxx:9200)”]  
opensearch.ssl.verificationMode: none  
opensearch.username: xxxxx  
opensearch.password: xxxxx  
opensearch.requestHeadersWhitelist: [authorization, securitytenant]  
opensearch\_security.multitenancy.enabled: true  
opensearch\_security.multitenancy.tenants.enable\_global: true  
opensearch\_security.multitenancy.tenants.enable\_private: true  
opensearch\_security.multitenancy.tenants.preferred: [Private, Global]  
opensearch\_security.readonly\_mode.roles: [kibana\_read\_only]  
opensearch\_security.multitenancy.enable\_filter: false

# Use this setting if you are running opensearch-dashboards without https

opensearch\_security.cookie.secure: false  
opensearch\_security.auth.type: “saml”  
server.xsrf.allowlist: [/\_plugins/\_security/saml/acs,/\_opendistro/\_security/saml/acs,/\_plugins/\_security/saml/acs/idpinitiated,/\_opendistro/\_security/saml/acs/idpinitiated,/\_plugins/\_security/saml/logout,/\_opendistro/\_security/saml/logout]

**Relevant Logs or Screenshots** :

The error from Opensearch Dashboards -

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/2/2856021a7760ebbc57e31ad074e12f1b1541fa62.png)

Please help me in fixing this issue.

Thanks for helping me.

Regards,  
Debashis

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 13, 2023, 10:30am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/2 "2023-02-13T10:30:43Z")

</div>

@dmallick19 Does your IDP use self-signed certs? If yes, try to add the cert to config.yml.

> **[SAML](https://opensearch.org/docs/latest/security/authentication-backends/saml/#certificate-validation)**
>
> SAML

---

<div class="post-metadata">

**Author:** ![dmallick19](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dmallick19](https://forum.opensearch.org/u/dmallick19)\
**Post date:** [February 13, 2023, 11:47am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/3 "2023-02-13T11:47:49Z")

</div>

Hi @pablo,

I don’t think, we are using the SSL Certs for IDP but I have it handy, so I have used it and got the same error.

Feb 13 05:44:56 [elknlr2cr2kb01.us.dell.com](http://elknlr2cr2kb01.us.dell.com) opensearch-dashboards[109940]: {“type”:“log”,“@timestamp”:“2023-02-13T11:44:56Z”,“tags”:[“error”,“plugins”,“securityDashboards”],“pid”:109940,“message”:“Failed to get saml header: Authentication Exception :: {"path":"/\_plugins/\_security/authinfo","query":{},"statusCode":401,"response":"Authentication finally failed"}”}  
Feb 13 05:44:56 [elknlr2cr2kb01.us.dell.com](http://elknlr2cr2kb01.us.dell.com) opensearch-dashboards[109940]: {“type”:“error”,“@timestamp”:“2023-02-13T11:44:56Z”,“tags”:,“pid”:109940,“level”:“error”,“error”:{“message”:“Internal Server Error”,“name”:“Error”,“stack”:“Error: Internal Server Error\n at HapiResponseAdapter.toError (/apps/data/usr\_share\_opensearch-dashboards/src/core/server/http/router/response\_adapter.js:143:19)\n at HapiResponseAdapter.toHapiResponse (/apps/data/usr\_share\_opensearch-dashboards/src/core/server/http/router/response\_adapter.js:97:19)\n at HapiResponseAdapter.handle (/apps/data/usr\_share\_opensearch-dashboards/src/core/server/http/router/response\_adapter.js:92:17)\n at Router.handle (/apps/data/usr\_share\_opensearch-dashboards/src/core/server/http/router/router.js:164:34)\n at runMicrotasks ()\n at processTicksAndRejections (internal/process/task\_queues.js:95:5)\n at handler (/apps/data/usr\_share\_opensearch-dashboards/src/core/server/http/router/router.js:124:50)\n at exports.Manager.execute (/apps/data/usr\_share\_opensearch-dashboards/node\_modules/@hapi/hapi/lib/toolkit.js:60:28)\n at Object.internals.handler (/apps/data/usr\_share\_opensearch-dashboards/node\_modules/@hapi/hapi/lib/handler.js:46:20)\n at exports.execute (/apps/data/usr\_share\_opensearch-dashboards/node\_modules/@hapi/hapi/lib/handler.js:31:20)\n at Request.\_lifecycle (/apps/data/usr\_share\_opensearch-dashboards/node\_modules/@hapi/hapi/lib/request.js:371:32)\n at Request.\_execute (/apps/data/usr\_share\_opensearch-dashboards/node\_modules/@hapi/hapi/lib/request.js:281:9)”},“url”:“[http://elk-r2.dell.com/auth/saml/login?nextUrl=%2Fkibana%2F&redirectHash=false",“message”:"Internal](http://elk-r2.dell.com/auth/saml/login?nextUrl=%2Fkibana%2F&redirectHash=false%22,%22message%22:%22Internal) Server Error”}

Regards,  
Debashis

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 17, 2023, 11:37pm UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/4 "2023-02-17T23:37:13Z")

</div>

@dmallick19 Where did you find this option?

```auto
acs: “https://elk-r2.dell.com/_plugins/_security/saml/acs”

```

Can’t find it in the documentation. Please take a look at the configuration example.

> **[SAML](https://opensearch.org/docs/latest/security/authentication-backends/saml/#minimal-configuration-example)**
>
> SAML

Also, Opensearch uses `_opendistro/_security/saml/acs` instead of `_plugins/_security/saml/acs`

> **[SAML](https://opensearch.org/docs/latest/security/authentication-backends/saml/#opensearch-dashboards-configuration)**
>
> SAML

---

<div class="post-metadata">

**Author:** ![dmallick19](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dmallick19](https://forum.opensearch.org/u/dmallick19)\
**Post date:** [February 20, 2023, 7:25am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/5 "2023-02-20T07:25:00Z")

</div>

Hi @pablo ,

Not using the acs option any more and I have tried using **\_opendistro/\_security?saml/acs** and also tried configuring saml using both Okta and Dell SAML and it seems like, it is failing at request\_id by cookies. Kindly help me fixing this issue.

Thankd & Regards,  
Debashis

---

<div class="post-metadata">

**Author:** ![rhtbansal](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rhtbansal](https://forum.opensearch.org/u/rhtbansal)\
**Post date:** [February 20, 2023, 7:32am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/6 "2023-02-20T07:32:26Z")

</div>

check the indentation in your config file everything does not comes left alligned. check SAML documentation arrange everything according to spacing there

---

<div class="post-metadata">

**Author:** ![dmallick19](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dmallick19](https://forum.opensearch.org/u/dmallick19)\
**Post date:** [February 20, 2023, 7:54am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/7 "2023-02-20T07:54:30Z")

</div>

Hi @rhtbansal,

The given config in this thread was just copy pate of the original config, where the indentations are properly aligned. And no error found while running security\_adming.sh.

Thanks,  
Debashis

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 20, 2023, 1:27pm UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/8 "2023-02-20T13:27:41Z")

</div>

@dmallick19 Did you check the logs in your reverse proxy? Do you pass a full response from the IDP to OpenSearch? What is your reverse proxy? Have you tried to bypass it just for testing?

---

<div class="post-metadata">

**Author:** ![dmallick19](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dmallick19](https://forum.opensearch.org/u/dmallick19)\
**Post date:** [February 20, 2023, 2:05pm UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/9 "2023-02-20T14:05:28Z")

</div>

Hi @pablo ,

We are using nginx as reverse proxy in the Opensearch Dashboards Server, and enabling SSL for the same server.

Thanks,  
Debashis

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 20, 2023, 3:23pm UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/10 "2023-02-20T15:23:09Z")

</div>

@dmallick19 Do you use HTTP or HTTPS between nginx and OpenSearch Dashboards?

---

<div class="post-metadata">

**Author:** ![dmallick19](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dmallick19](https://forum.opensearch.org/u/dmallick19)\
**Post date:** [February 20, 2023, 5:06pm UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/11 "2023-02-20T17:06:38Z")

</div>

Hi @pablo ,

There is actually SSL between nginx and Opensearch Dashboards. Nginx running on port 443 and Opensearch Dashboards running on [http://localhost:5601](http://localhost:5601).

Thanks,  
Debashis

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 20, 2023, 5:54pm UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/12 "2023-02-20T17:54:32Z")

</div>

@dmallick19 Would be there any chance to see nginx config file?

---

<div class="post-metadata">

**Author:** ![dmallick19](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dmallick19](https://forum.opensearch.org/u/dmallick19)\
**Post date:** [February 21, 2023, 7:52am UTC](https://forum.opensearch.org/t/unable-to-configure-saml-using-idp-metadata-file/12479/13 "2023-02-21T07:52:48Z")

</div>

Hi @pablo ,

Please find the nginx configuration below -

server {  
listen 443;  
server\_name [elk-r2.dell.com](http://elk-r2.dell.com), [xxxx.us.dell.com](http://xxxx.us.dell.com);

```
ssl_certificate /etc/nginx/elk-r2.pem;
ssl_certificate_key /etc/nginx/elk-r2.key;

ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log main;

location ~ ^/(.*)$ {
    rewrite /kibana/(.*) /$1 break;
    proxy_pass http://localhost:5601;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header host $host;
    proxy_cache_bypass $http_upgrade;
}

```

}
