Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Plat-Arch-204 Exam - Topic 4 Question 13 Discussion

What is the first thing an integration architect should validate if a callout from a Lightning web component (LWC) to an external endpoint is failing?
C) The endpoint URL has been added to Content Security Policies (CSP).
A) The endpoint domain has been added to Cross-Origin Resource Sharing (CORS).
B) The endpoint URL has been added to Remote Site Settings.

Salesforce Plat-Arch-204 Exam - Topic 4 Question 13 Discussion

Actual exam question for Salesforce's Plat-Arch-204 exam
Question #: 13
Topic #: 4
[All Plat-Arch-204 Questions]

What is the first thing an integration architect should validate if a callout from a Lightning web component (LWC) to an external endpoint is failing?

Show Suggested Answer Hide Answer
Suggested Answer: C

When an integration initiated from the client-side (the browser) fails, the architect must first look at the browser's security policies. In Salesforce, Lightning Web Components are subject to the Lightning Component framework's Content Security Policy (CSP).

CSP is a security layer that prevents cross-site scripting (XSS) and other code injection attacks by restricting which domains the browser is allowed to communicate with. If an LWC attempts to make a fetch() call to an external REST endpoint, the browser will block the request unless that specific domain is whitelisted in CSP Trusted Sites.

Option B (Remote Site Settings) is a common distractor; these settings are strictly for server-side Apex callouts and have no effect on client-side JavaScript requests. Option A (CORS) is also a browser security mechanism, but it must be configured on the external server to allow Salesforce to access its resources. While CORS is necessary, the first thing to validate within the Salesforce environment for a failing LWC callout is the CSP Trusted Site entry. Without this whitelisting, the request will be terminated by the browser before it even leaves the client, regardless of how the external server is configured.


Contribute your Thoughts:

0/2000 characters
Melodie
4 days ago
Definitely check CORS first!
upvoted 0 times
...
Lynna
9 days ago
I definitely remember that CORS is crucial for external calls, so I would lean towards that being the right answer.
upvoted 0 times
...
Annita
14 days ago
I feel like CSP might be important too, but I can't recall if it's the first step or not.
upvoted 0 times
...
Solange
19 days ago
I remember practicing a question about Remote Site Settings, so maybe that's the first thing to validate?
upvoted 0 times
...
Louann
24 days ago
I think the first thing to check would be if the endpoint domain is in the CORS settings, but I'm not entirely sure.
upvoted 0 times
...

Save Cancel