Salesforce Decode
Salesforcedecode
Back to questions
LWCAdvancedexperience-cloudlwrsecurity

Integrate Experience Cloud LWR site with LWC and guest-safe Apex

Real World Scenario

LWR community site LWCs call Apex returning data visible to guest on public product catalog but leak warehouse stock from internal field.

Expected Answer

• Guest user profile FLS audit on every field in wire and Apex response • Separate GuestCatalogController with minimal field DTO • lightningCommunity__Page targets in meta xml for LWR placement • CSP and LWR styling differences from Aura communities testing • Public cache headers on static catalog slices where appropriate • No internal navigation URLs exposed in guest LWC templates • Security review guest Apex quarterly as profiles evolve

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Guest user profile FLS audit on every field in wire and Apex response. Separate GuestCatalogController with minimal field DTO. Pick based on your integration pattern and team capability. LWR guest sites need dedicated minimal Apex surface—not reuse internal controller with stripInaccessible hope. Optimize for scale and operational observability.

Architect Perspective

LWR guest sites need dedicated minimal Apex surface—not reuse internal controller with stripInaccessible hope.