# \[User Impersonation with X-Pack\] action \[cluster:admin/xpack/security/user/authenticate\] is unauthorized for user

**URL:** <https://discuss.elastic.co/t/user-impersonation-with-x-pack-action-cluster-admin-xpack-security-user-authenticate-is-unauthorized-for-user/203685>\
**Category:** Kibana\
**Created:** [October 15, 2019, 3:22pm UTC](https://discuss.elastic.co/t/user-impersonation-with-x-pack-action-cluster-admin-xpack-security-user-authenticate-is-unauthorized-for-user/203685 "2019-10-15T15:22:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joao\_Palma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joao_palma/32/45243_2.png) [@Joao\_Palma](https://discuss.elastic.co/u/Joao_Palma)\
**Post date:** [October 15, 2019, 3:22pm UTC](https://discuss.elastic.co/t/user-impersonation-with-x-pack-action-cluster-admin-xpack-security-user-authenticate-is-unauthorized-for-user/203685/1 "2019-10-15T15:22:54Z")

</div>

Hello,

I'm trying configure ELK with SSO (keycloak)..  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/7/2/72f76570ebeaf4fb73b5d636971bb72cfd8fd677.png)  
I'm using this architecture but i got this error {"statusCode":403,"error":"Forbidden","message":"[security\_exception] action [cluster:admin/xpack/security/user/authenticate] is unauthorized for user [nginx] run as [user1@mail.pt]"}

nginx have privilege run as user1 configured in a role! Can you help me?

Thanks

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [October 17, 2019, 8:34pm UTC](https://discuss.elastic.co/t/user-impersonation-with-x-pack-action-cluster-admin-xpack-security-user-authenticate-is-unauthorized-for-user/203685/2 "2019-10-17T20:34:48Z")

</div>

@Brandon_Kobel or @Larry_Gregory Do you or someone on the security team have some insight here?

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 17, 2019, 9:16pm UTC](https://discuss.elastic.co/t/user-impersonation-with-x-pack-action-cluster-admin-xpack-security-user-authenticate-is-unauthorized-for-user/203685/3 "2019-10-17T21:16:30Z")

</div>

@Joao_Palma can you share the role definitions for the `nginx` user?

---

<div class="post-metadata">

**Author:** ![Joao\_Palma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joao_palma/32/45243_2.png) [@Joao\_Palma](https://discuss.elastic.co/u/Joao_Palma)\
**Post date:** [October 18, 2019, 9:16am UTC](https://discuss.elastic.co/t/user-impersonation-with-x-pack-action-cluster-admin-xpack-security-user-authenticate-is-unauthorized-for-user/203685/4 "2019-10-18T09:16:43Z")

</div>

Hello,  
The error is the SSO, he send the email in forwarded username... I fix this, using a script in LUA

Thanks to everyone

---

<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:** [November 15, 2019, 9:16am UTC](https://discuss.elastic.co/t/user-impersonation-with-x-pack-action-cluster-admin-xpack-security-user-authenticate-is-unauthorized-for-user/203685/5 "2019-11-15T09:16:51Z")

</div>

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