# Are Elasticsearch Security API authenticate responses the same for different logged-in users?

**URL:** <https://discuss.elastic.co/t/are-elasticsearch-security-api-authenticate-responses-the-same-for-different-logged-in-users/355376>\
**Category:** Elastic Security\
**Created:** [March 14, 2024, 8:18am UTC](https://discuss.elastic.co/t/are-elasticsearch-security-api-authenticate-responses-the-same-for-different-logged-in-users/355376 "2024-03-14T08:18:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bertugmete](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bertugmete](https://discuss.elastic.co/u/bertugmete)\
**Post date:** [March 14, 2024, 8:18am UTC](https://discuss.elastic.co/t/are-elasticsearch-security-api-authenticate-responses-the-same-for-different-logged-in-users/355376/1 "2024-03-14T08:18:17Z")

</div>

My goal is to retrieve information about logged-in users, and for that, I'm using the [Authenticate API | Elasticsearch Guide [8.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html) API. However, when I log in with different users, all values such as username, roles, etc., are coming out the same. Could I have made a mistake in configuring Kibana?

This is the function;

```auto
const user = await clusterClient.asInternalUser.security.authenticate();

```

---

<div class="post-metadata">

**Author:** ![RylandHerrick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rylandherrick/32/67401_2.png) [@RylandHerrick](https://discuss.elastic.co/u/RylandHerrick)\
**Post date:** [March 14, 2024, 3:58pm UTC](https://discuss.elastic.co/t/are-elasticsearch-security-api-authenticate-responses-the-same-for-different-logged-in-users/355376/2 "2024-03-14T15:58:17Z")

</div>

Hey @bertugmete! `asInternalUser` will return the internal kibana user, which explains why you'd be seeing that consistently. What you want instead is [`asCurrentUser`](https://www.elastic.co/guide/en/kibana/current/elasticsearch-service.html).

---

<div class="post-metadata">

**Author:** ![RylandHerrick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rylandherrick/32/67401_2.png) [@RylandHerrick](https://discuss.elastic.co/u/RylandHerrick)\
**Post date:** [April 3, 2024, 5:48pm UTC](https://discuss.elastic.co/t/are-elasticsearch-security-api-authenticate-responses-the-same-for-different-logged-in-users/355376/3 "2024-04-03T17:48:09Z")

</div>

@bertugmete was this answer helpful? If so, please mark it as the solution, and if not, please clarify. Posterity thanks you!

---

<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, 2024, 5:48pm UTC](https://discuss.elastic.co/t/are-elasticsearch-security-api-authenticate-responses-the-same-for-different-logged-in-users/355376/4 "2024-05-01T17:48:59Z")

</div>

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