# Pass current user's identity to Connector/LLM?

**URL:** <https://forum.opensearch.org/t/pass-current-users-identity-to-connector-llm/25919>\
**Category:** Machine Learning\
**Created:** [July 21, 2025, 12:20pm UTC](https://forum.opensearch.org/t/pass-current-users-identity-to-connector-llm/25919 "2025-07-21T12:20:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeHeron](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@LeHeron](https://forum.opensearch.org/u/LeHeron)\
**Post date:** [July 21, 2025, 12:20pm UTC](https://forum.opensearch.org/t/pass-current-users-identity-to-connector-llm/25919/1 "2025-07-21T12:20:03Z")

</div>

Hello.  
I’m working on implementing a native ML setup in OpenSearch, which involves a conversational agent linked to an external LLM (a custom one)  
For our unique architectural needs, I need to pass along the **OpenSearch user’s identity** [in the http header] . I’m having trouble locating the correct variable (assuming there is one) to specify in the connector.

**Versions** OpenSearch 2.19

---

<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:** [July 21, 2025, 6:47pm UTC](https://forum.opensearch.org/t/pass-current-users-identity-to-connector-llm/25919/2 "2025-07-21T18:47:54Z")

</div>

@LeHeron I think the most universal way would be calling `_plugins/_security/authinfo` endpoint with authenticated user.  
What type of authentication do you use?

---

<div class="post-metadata">

**Author:** ![nathhjo](https://avatars.discourse-cdn.com/v4/letter/n/ec9cab/32.png) [@nathhjo](https://forum.opensearch.org/u/nathhjo)\
**Post date:** [July 22, 2025, 12:13am UTC](https://forum.opensearch.org/t/pass-current-users-identity-to-connector-llm/25919/3 "2025-07-22T00:13:38Z")

</div>

Hi @LeHeron, we can specify API key or AWS credentials for the authentication when creating the connector. You can refer to this doc for more information [Connectors - OpenSearch Documentation](https://docs.opensearch.org/docs/latest/ml-commons-plugin/remote-models/connectors/). Can you share more details about your use case, including the authentication method and the current connector request payload you’re using?

---

<div class="post-metadata">

**Author:** ![LeHeron](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@LeHeron](https://forum.opensearch.org/u/LeHeron)\
**Post date:** [July 22, 2025, 10:08pm UTC](https://forum.opensearch.org/t/pass-current-users-identity-to-connector-llm/25919/4 "2025-07-22T22:08:52Z")

</div>

Hello everyone,

Thank you for your responses and suggestions, @pablo and @nathhjo.

I believe there might be a slight misunderstanding regarding my need, and I apologize if my initial question lacked clarity.

My goal is **not to authenticate** the OpenSearch user to the external LLM. (authentication is already handled at a different architectural level and isn’t the issue here)

What I’m trying to do is **pass the OpenSearch user’s identity (the “who” is making the request to the LLM)** - undertone “who is using the Conversational Agent” - in the HTTP request sent to my custom LLM via the connector. In other words, I want the LLM to know which OpenSearch user originated the request, and I’m looking for the variable or method to retrieve this information within OpenSearch to include it in the connector’s `request_payload`.  
As usage of Agent/Connector/Models/.. are already subject to permission management [cf. userroles, backendroles], i guess this _information_ already available somewhere. my point is to know if that one could be _export_

I hope this clarifies my request a bit better. Please let me know if you need more details.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [September 20, 2025, 10:09pm UTC](https://forum.opensearch.org/t/pass-current-users-identity-to-connector-llm/25919/5 "2025-09-20T22:09:07Z")

</div>

Closed on September 20, 2025, 10:09pm UTC

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