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

My goal is to retrieve information about logged-in users, and for that, I'm using the Authenticate API | Elasticsearch Guide [8.12] | Elastic 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;

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

Hey @bertugmete! asInternalUser will return the internal kibana user, which explains why you'd be seeing that consistently. What you want instead is asCurrentUser.

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

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