# How to Capture External User Details in Pega Web Embed via additionalHeaders

**URL:** <https://forums.pega.com/t/how-to-capture-external-user-details-in-pega-web-embed-via-additionalheaders/9891>\
**Category:** User Experience\
**Tags:** microjourney, manufacturing, cloud-services, pega-cloud, dx-api, government, insurance, java-and-activities, theme-cosmos, other-industry, financial-services, 24-2-1, app-studio, cross-industry, healthcare-and-life-sciences, constellation, user-experience, data-integration, data-model, pega-platform, system-architect, lead-system-architect, case-management\
**Created:** [August 26, 2025, 5:55am UTC](https://forums.pega.com/t/how-to-capture-external-user-details-in-pega-web-embed-via-additionalheaders/9891 "2025-08-26T05:55:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CharanRathod](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/charanrathod/32/2330_2.png) [@CharanRathod](https://forums.pega.com/u/CharanRathod)\
**Post date:** [August 26, 2025, 5:55am UTC](https://forums.pega.com/t/how-to-capture-external-user-details-in-pega-web-embed-via-additionalheaders/9891/1 "2025-08-26T05:55:25Z")

</div>

I am implementing Pega Web Embed to allow users from an external system to interact with a Pega application (e.g., for case creation, assignment submission, or viewing user pages).

I have a requirement to capture and identify the external user’s details (such as a user ID, name, or system token) every time their session initiates a request to the Pega server. My understanding is that the `additionalHeaders` attribute in the Web Embed configuration is the intended method to pass this information.

However, I am unsure of the correct syntax and structure to use for this attribute. The documentation I’ve found does not provide a clear example.

**What I’ve Tried/Ideas:**

- I have configured the basic Web Embed component successfully and it functions for its primary purpose (case creation, etc.).

- I am attempting to use the `additionalHeaders` attribute to include the user information in the HTTP headers of the requests made to Pega.

- I am looking for a way to dynamically pass values from the external system into these headers.

- **\<pega-embed**  
**id=‘myEmbed’**  
**action=‘createCase’**  
**caseTypeID=‘MyCo-MyApp-Work-MyCaseType’**  
**casePage=‘assignment’**  
**appAlias=‘my-app-alias’**  
**pegaServerUrl=‘[https://mypegaserver.com/prweb/](https://mypegaserver.com/prweb/)’**  
**style=‘width:100%; height:500px;’**  
**startingFields=‘{“pyLabel”: “External Case”}’\>**

---

<div class="post-metadata">

**Author:** ![SudheerKumarGoudB3761](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@SudheerKumarGoudB3761](https://forums.pega.com/u/SudheerKumarGoudB3761)\
**Post date:** [August 26, 2025, 4:09pm UTC](https://forums.pega.com/t/how-to-capture-external-user-details-in-pega-web-embed-via-additionalheaders/9891/2 "2025-08-26T16:09:28Z")

</div>

Hi @CharanRathod

You can handle this with the additionalHeaders attribute. Just pass your external user details from JS into the embed like:

```auto
additionalHeaders='{"X-External-User-ID": "' + externalUserId + '"}' 

```

Now every request from the embed carries the user ID. On the Pega side, just read that header in your auth/service layer and map it.

eg :

\<pega-embed  
id=“myEmbed”  
action=“createCase”  
caseTypeID=“MyCo-MyApp-Work-MyCaseType”  
pegaServerUrl=“[https://mypegaserver.com/prweb/](https://mypegaserver.com/prweb/)”  
appAlias=“my-app-alias”  
style=“width:100%; height:500px;”  
additionalHeaders=‘{“X-External-User-ID”: "’ + externalUserId + ‘"}’\>

---

<div class="post-metadata">

**Author:** ![CharanRathod](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/charanrathod/32/2330_2.png) [@CharanRathod](https://forums.pega.com/u/CharanRathod)\
**Post date:** [September 3, 2025, 10:41am UTC](https://forums.pega.com/t/how-to-capture-external-user-details-in-pega-web-embed-via-additionalheaders/9891/3 "2025-09-03T10:41:01Z")

</div>

Hi @SudheerKumarGoudB3761,

Thank you for the help. The issue is resolved.

We used the additional header to receive the user details in DXApi Headers. However, we faced “No ‘Access-Control-Allow-Origin’ Header”.

The solution was to add the exact names of our custom header fields (from the `additionalHeaders` attribute) to the **“Access-Control-Allow-Headers”** setting in the CORS configuration on the Pega server.

Once the server was configured to explicitly allow our custom headers, the preflight requests succeeded, and the error was resolved.

 ![This is a screenshot from CORS rule.png](https://pega1.discourse-cdn.com/pega/original/2X/f/fbd652524d0eb9fb21b8a03134794d44e5539abc.png)

 ![This is a screenshot from CORS rule.png](https://pega1.discourse-cdn.com/pega/original/2X/f/fbd652524d0eb9fb21b8a03134794d44e5539abc.png)
