Skip to main content
6 votes
Accepted

How to get the JSON response using Einstein in Web Recommendations?

You should make use of callback parameter in the call to recommend.json - you can easily append it if you have existing parameters in your querystring: https://{MID}.recs.igodigital.com/a/v2/{MID}>...
Lukas Lunow's user avatar
  • 22.2k
5 votes
Accepted

Flow exposed in external website using Lightning out - Not Rendering, no error

There is no init handler in the component code. <aura:handler name="init" value="{!this}" action="{!c.init}"/>
Howdy Ranger's user avatar
5 votes

CORS APEX Rest Services

Looks like Apex REST now supports CORS: http://blog.lkatney.com/2016/05/04/salesforces-summer-16-release-is-here/ Apex REST now supports CORS. To access Apex REST classes from JavaScript in a web ...
Chuckie B's user avatar
5 votes
Accepted

CORS whitelisting not working as expected

Ok. I did some research on this and looks like we both interpreted the Salesforce CORS documentation wrongly. Salesforce CORS says that CORS is only for making requests to Supported Salesforce APIs, ...
javanoob's user avatar
  • 8,957
5 votes
Accepted

Blocked by CORS policy: No 'Access-Control-Allow-Origin' header on the requested resource

If additional script resources are necessary, they will be denied because of Lightning's very restrictive CSP. You cannot fix this. As an alternative, consider using D3js, which can run without any ...
sfdcfox's user avatar
  • 502k
5 votes

CORS: No "Access-Control-Allow-Origin" header is present on the requested resource

I believe all major browsers specifically ignore localhost as a legal target for Access-Control-Allow-Origin as a security measure. There's a question with an answer that goes in to more detail you ...
sfdcfox's user avatar
  • 502k
4 votes
Accepted

Salesforce (Lightning components ) CORS policy blocks origin from same domain

This is a restriction not related to Lighting CORS; all browsers block this sort of behavior to protect against various security exploits. Instead, call a server action and retrieve the file in Apex, ...
sfdcfox's user avatar
  • 502k
4 votes

Refused to load script because it violates Content Security Policy directive

You will have to tweak your external JS, load the other referenced JS files also as static resources and include them in aura component using ltng:require. Refer to CSP Overview JavaScript libraries ...
arut's user avatar
  • 5,371
3 votes

Externally hosted Javascript is unable to access Visualforce page

It seems, you need to add few of the domains in the whitelisted settings. As per this Allow the Required Domains : If you control your users’ or servers’ access to the Internet through allowlists, ...
Ysr Shk's user avatar
  • 3,175
3 votes
Accepted

REST API OAuth2 CORS Issue

You need to redirect the browser to the login server. The process won't work with XMLHttpRequest/JavaScript, even if there was CORS, because it is inherently a browser-based flow. The correct order of ...
sfdcfox's user avatar
  • 502k
3 votes
Accepted

Enable CORS for Visualforce page

You should never directly overwrite window.onload in a Visualforce page, as this can cause bad things to happen. If you wish to keep the code as is, use a proper event handler: window.addEventListener(...
sfdcfox's user avatar
  • 502k
3 votes
Accepted

Why is CORS-Event-Count" event type is not available for selection in the "Event Log File Browser"

//Self-created question to help on the multi customer issue// This has been reported by several customers. Our Salesforce team is aware of this issue and working on a fix. I will update this thread as ...
Swetha Maddali's user avatar
3 votes
Accepted

Lightning Out : getting "No 'Access-Control-Allow-Origin' header is present on the requested resource" from Heroku App

The issue here could be due to any of below The OAuth token is incorrect The lightning domain you have is incorrect. It typically ends with lightning.force.com and not same as myDomain as you have in ...
Mohith Shrivastava's user avatar
2 votes
Accepted

Lightning Out using ltng:require: How to deal with CORS when Locker Service enabled?

It appears that $resource is not correctly absolutizing URLs like it is supposed to - known bug tracking this is W-3633321. This issue is not specific to Locker however. There is another issue ...
Doug Chasman's user avatar
  • 10.1k
2 votes

CORS error in Visualforce page

Cross-Origin Resource Sharing (CORS) enables web browsers to request resources from origins other than their own (cross-origin). For example, using CORS, JavaScript code at https://www.example.com ...
NITHESH K's user avatar
  • 2,555
2 votes

CORS error in Visualforce page

You need to whitelist your own visualforce page with the request you're trying to perform. Try going to Setup -> CORS and add https://*.visual.force.com as a whitelisted origin
Brian Miller's user avatar
  • 5,242
2 votes
Accepted

Lightning Out: CORS error even after whitelisting force.com site

It's not intuitive but the expected way to embed lightning components for guest users is with a public access community rather than a force.com site directly. I believe you can make it work with a ...
Greg Grinberg's user avatar
2 votes

Access PDF File from the Files Tab

So as per your updated question and requirement of lightning component to view/load/download any kind of file in browser then you should get respective Content Version of the file you wish to view/...
7'7''s user avatar
  • 380
2 votes

Access PDF File from the Files Tab

Usually when you try to access any file form Files tab you will access the ContentDocument ID with URL something like this https://sample-dev-ed.lightning.force.com/lightning/r/ContentDocument/...
7'7''s user avatar
  • 380
2 votes

How can i use Marketing cloud Rest API in client side?

You should never invoke this or any similar API from the frontend / client side. If you do so your credentials (client id and secret) are exposed to everyone. A user can therefore attack (depending on ...
Markus Dang - formerly Slabina's user avatar
2 votes

Call Salesforce API from client side code in Aura/LWC

I was able to solve this problem by using the uiRecordApi. The documentation around using this can be found here. Salesforce confirmed passing the session id generated from a VF page to your LWC ...
Philip Jones's user avatar
2 votes
Accepted

iframe/embed salesforce into another site

No, you can't iframe/embed Salesforce in an app. You'd want to use an OAuth flow with a state parameter to navigate the user back to the previous state in your web app. See the Web Server Flow ...
sfdcfox's user avatar
  • 502k
2 votes
Accepted

Marketing Cloud API Request - Access to fetch at '[auth URL]' from origin 'https://localhost:3000' has been blocked by CORS policy

I found the answer after talking with support: If you're familiar with CORS, the reason for it is to prevent cross-domain scripting (to prevent phishing attempts), which menas you can't run a call ...
balwill's user avatar
  • 348
2 votes

Log in to salesforce from a react app

Use the OAuth 2.0 Web Server Flow for Web App Integration. You start by redirecting the user to: https://login.salesforce.com/services/oauth2/authorize?client_id=...
sfdcfox's user avatar
  • 502k
2 votes
Accepted

Http CORS violation from Customer Digital Experience

The CORS violation entry ORIGIN http://support.mycompany.com is stating that a request from this http page attempted to access port 443 of support.mycompany.com; i.e. make an https request. How could ...
cropredy's user avatar
  • 73.3k
2 votes

CORS Issue Preventing LWC Component from Accessing Salesforce Apex Controller - No 'Access-Control-Allow-Origin' Header Present

Thank you all for your help! After seeing the same CORS error even after disabling the enhanced domains, I suspected that a new Apex controller might do the trick. I cloned the original controller, ...
Lakshmi's user avatar
  • 61
1 vote
Accepted

What does same origin policy mean when trying to submit a Web to lead form via AJAX?

What is CORS? A cross-origin resource sharing request occurs when JavaScript from domain A attempts to contact domain B. This occurs even when domain A and domain B are both subdomains under domain C. ...
sfdcfox's user avatar
  • 502k
1 vote

Lightning Out/Appointment Scheduling CORB issue

Some combination of jumping into the community and setting it public, and removing the 's/' from the community URLs seemed to have fixed the issue. Lightning out is coming through ok, and am able to ...
Matt Bratton's user avatar
1 vote
Accepted

Externally hosted Javascript is unable to access Visualforce page

You cannot access a Visualforce page from an external site unless you create a Salesforce site and access it. See this answer for details: Visual Force Page which can be accessed by anyone
pvukovic's user avatar
  • 300
1 vote

OAuth 2.0 JWT Bearer Flow - XMLHttpRequest CORS and SameSite error and Gack

To Summerize what fixed this issue for us: We added the Integration User to the Site (Community). Selected the Orgwide session setting - Setup > Security > Session Settings - "Activate the ...
M. Brandel's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible