# Opensearch JavaScript client

**URL:** <https://forum.opensearch.org/t/opensearch-javascript-client/7266>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-js\
**Created:** [October 12, 2021, 2:59pm UTC](https://forum.opensearch.org/t/opensearch-javascript-client/7266 "2021-10-12T14:59:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![clenkiu](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@clenkiu](https://forum.opensearch.org/u/clenkiu)\
**Post date:** [October 12, 2021, 2:59pm UTC](https://forum.opensearch.org/t/opensearch-javascript-client/7266/1 "2021-10-12T14:59:13Z")

</div>

Is there any plan to support SAML authentication to the OpenSearch JavaScript client?  
I mean, implementing an API similar to the existing elasticsearch nodejs client.

> **[API Reference | Elasticsearch JavaScript Client \[8.4\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#_security_samlprepareauthentication)**

If not.  
Is there a way to authenticate users with elasticserach nodejs client using SAML, as the elasticsearch nodejs version 7.13 doesn’t have the SAML APIs mentioned above.

---

<div class="post-metadata">

**Author:** ![oscark](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/oscark/32/866_2.png) [@oscark](https://forum.opensearch.org/u/oscark)\
**Post date:** [October 13, 2021, 8:21am UTC](https://forum.opensearch.org/t/opensearch-javascript-client/7266/2 "2021-10-13T08:21:41Z")

</div>

First question: IDK.

Second question: I haven’t tried this but I would assume that if you trust the client, it should be possible to use proxy-based authentication. [Proxy-based authentication - OpenSearch documentation](https://opensearch.org/docs/latest/security-plugin/configuration/proxy/)

---

<div class="post-metadata">

**Author:** ![clenkiu](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@clenkiu](https://forum.opensearch.org/u/clenkiu)\
**Post date:** [October 13, 2021, 1:16pm UTC](https://forum.opensearch.org/t/opensearch-javascript-client/7266/3 "2021-10-13T13:16:13Z")

</div>

Thanks, @oscark .  
Yes, it looks promising. I am going to check if I can integrate it into our solution.

---

<div class="post-metadata">

**Author:** ![vamshin](https://avatars.discourse-cdn.com/v4/letter/v/c5a1d2/32.png) [@vamshin](https://forum.opensearch.org/u/vamshin)\
**Post date:** [October 14, 2021, 6:03am UTC](https://forum.opensearch.org/t/opensearch-javascript-client/7266/4 "2021-10-14T06:03:09Z")

</div>

@clenkiu Please create github issue for feature request on supporting SAML authentication in the OpenSearch JavaScript client  
Repo: [GitHub - opensearch-project/opensearch-js: Node.js Client for OpenSearch](https://github.com/opensearch-project/opensearch-js)

---

<div class="post-metadata">

**Author:** ![clenkiu](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@clenkiu](https://forum.opensearch.org/u/clenkiu)\
**Post date:** [October 14, 2021, 3:10pm UTC](https://forum.opensearch.org/t/opensearch-javascript-client/7266/5 "2021-10-14T15:10:26Z")

</div>

> [@vamshin](#):
>
> supporting SAML authentication i

I created the following issue:

> <https://github.com/opensearch-project/opensearch-js/issues/186>
>
> The OpenSearch JavaScript client only supports basic authentication on its imple…mentation.
> It is not possible to use the library authenticating users with SSO, using SAML authentication.
> 
> This is, by example, implemented in the ElasticSearch nodejs client version 7.14 and above, as described here:.
> https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#\_security\_samlprepareauthentication
> https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#\_security\_samlauthenticate
> 
> I would like to have a similar implementation in the OpenSearch JavaScript client.
