# How to Pass End-User Identity to Pega When Using OAuth Client Credentials Grant with DX API

**URL:** <https://forums.pega.com/t/how-to-pass-end-user-identity-to-pega-when-using-oauth-client-credentials-grant-with-dx-api/12158>\
**Category:** General\
**Created:** [May 29, 2026, 2:02am UTC](https://forums.pega.com/t/how-to-pass-end-user-identity-to-pega-when-using-oauth-client-credentials-grant-with-dx-api/12158 "2026-05-29T02:02:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnilKumarS1783](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AnilKumarS1783](https://forums.pega.com/u/AnilKumarS1783)\
**Post date:** [May 29, 2026, 2:02am UTC](https://forums.pega.com/t/how-to-pass-end-user-identity-to-pega-when-using-oauth-client-credentials-grant-with-dx-api/12158/1 "2026-05-29T02:02:23Z")

</div>

Hi All,

We have a React application that communicates with Pega using the DX API. For authentication, we are using the OAuth 2.0 Client Credentials grant type. Currently, all cases created via the API are audited under the service account associated with the client credentials, rather than the actual end-user who initiated the action in the React app.

Is there a recommended approach to pass the end-user’s identity (e.g., username) to Pega, so that case history, assignment creation, and auditing reflect the real user instead of the service account? Are there best practices or supported patterns for achieving this with the DX API and OAuth client credentials flow?

Any guidance or examples would be greatly appreciated!

Thank you.

---

<div class="post-metadata">

**Author:** ![KamilJaneczek](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/kamiljaneczek/32/23339_2.png) [@KamilJaneczek](https://forums.pega.com/u/KamilJaneczek)\
**Post date:** [May 29, 2026, 8:37am UTC](https://forums.pega.com/t/how-to-pass-end-user-identity-to-pega-when-using-oauth-client-credentials-grant-with-dx-api/12158/2 "2026-05-29T08:37:34Z")

</div>

Client credentials is more server to server authentiation so there is no standard way to impersonate user.

This is typically supported but auth code flow? Are you able to switch to it?  
If not then maybe you can explore customAuth flow? [Custom Bearer Grant Type](https://forums.pega.com/t/custom-bearer-grant-type/10281)

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [May 29, 2026, 3:42pm UTC](https://forums.pega.com/t/how-to-pass-end-user-identity-to-pega-when-using-oauth-client-credentials-grant-with-dx-api/12158/3 "2026-05-29T15:42:06Z")

</div>

I believe using JSON Web Tokens (JWT) between services is a common way to handle authentication and authorization in micro services.

OAuth 2.0 JWT Bearer Token Authentication might help for your scenario.
