Loading

LWC Running in Guest User Context in Embedded Messaging on Experience Cloud Site

Udgivelsesdato: Sep 22, 2026
Beskrivelse

On an Experience Cloud site with Embedded Messaging configured, custom LWCs embedded in the chat widget — or Custom Lightning Types (CLTs) used in Agentforce conversations — may run in the Guest User context even when the end user is authenticated on the parent Experience Cloud site.

This results in:

  • Inability to retrieve the logged-in User ID from a pre-chat LWC.
  • Imperative Apex calls returning Guest User data or throwing insufficient access errors.
  • @wire adapters returning no data or guest-scoped results.
  • Apex returning UserType = Guest despite the user being logged in on the parent site.
  • CLT components in Agentforce failing to fetch user-specific data via Apex or @wire.
Løsning
Add the logged-in user's profile or relevant permission set to the Members section of the ESD Site associated with the Embedded Messaging deployment.
Steps
  1. Go to Setup → All Sites. Click Workspaces next to your ESD Site.
  2. Go to Administration → Members.
  3. Under Search, choose Profile or Permission Set from the dropdown.
  4. Find and add the profile(s) used by your Experience Cloud community members.
  5. Click Save.
  6. Test the LWC in the chat widget. It should now execute in the logged-in user's context.
Tip
Verify the fix using browser DevTools network requests. Look for asGuest: false on LWC wire requests after the change.
Yderligere ressourcer
  • This behavior affects all client-side operations inside the chat widget LWC: @wire adapters, imperative Apex calls, and Lightning Data Service (ui-record-api) calls.
  • The ESD Site's Members section must mirror the profiles and permission sets configured on the parent Experience Cloud site for consistent behavior.
  • This is expected platform behavior. The ESD Site is an independent site and requires its own membership configuration.
  • Agentforce — Custom Lightning Types (CLT): Custom Lightning Types used in Agentforce conversations are affected. If a CLT component invokes Apex or uses @wire adapters, and the user's profile is not in the ESD Site's Members, those operations will run in the Guest User context. Add the relevant profile(s) to the Members section of the ESD Site to ensure CLTs run in the logged-in user's context.

Reference: https://help.salesforce.com/s/articleView?id=platform.networks_customize_members.htm&type=5

Vidensartikelnummer

005389197

 
Indlæser
Salesforce Help | Article