Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [cors]

Questions related to Cross-origin resource sharing (CORS) within Salesforce. This error can usually be identified using the browser's developer tools.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Request for rich text area images from same salesforce org gives CORS error

I am trying to get the blob of the image from the image urls which are part of html content in Rich Text area field .i.e RTA images (eg url: <img src="https://instance-domain.sandbox.file....
AdityaHM's user avatar
  • 133
0 votes
0 answers
58 views

CORS Error when importing third party javascript libraries in LWC

I'm encountering an issue while attempting to integrate a third-party library into my Lightning Web Component (LWC). Despite configuring CORS settings and remote site settings, I am unable to make the ...
Krishnamurthy's user avatar
0 votes
1 answer
47 views

I have 2 salesforce org and I am making api call from one org's lwc component to get access token of another org but I am getting below error

This is my JS code from LWC component. import { LightningElement } from 'lwc'; const MY_URL = 'https://login.salesforce.com/services/oauth2/token'; const Data ='username=username.com&password=...
shubham kakade's user avatar
0 votes
1 answer
267 views

Chrome extension has been blocked by CORS policy: Response to preflight request doesn't pass access control check

We've been using a third party Chrome extension from a vendor (Groove) to sync emails/calendar items with Salesforce. It has worked great for 12+ months but suddenly stopped working with various ...
cropredy's user avatar
  • 72.2k
1 vote
1 answer
682 views

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

I am working on a Lightning Web Component (LWC) in Salesforce that fetches data from a custom Apex controller. Unfortunately, I am facing a CORS (Cross-Origin Resource Sharing) issue that prevents the ...
Lakshmi's user avatar
  • 61
-1 votes
1 answer
804 views

Access to fetch has been blocked by CORS policy - LWC

I'm having the following error once I try to do a POST in an outside link of my Salesforce org, So, I've already added this URL to the "CSP Trusted Sites" and the "Remote Site ...
André Rödel's user avatar
0 votes
1 answer
183 views

Lightning out loads but apex calls return cors error

The lightning out(LO) app I have created worked fine. I did not use it however for a few months and now i get a 'Redirect is not allowed for a preflight request' error when my LWC tries to make an ...
Dane's user avatar
  • 145
2 votes
1 answer
376 views

Visualforce CORS Error Even When Origin Is Whitelisted, Headers Are Also Set

I'm creating a PDF viewer using Visualforce and the PDF.js library. My project doesn't include react. When I try to execute pdfjsLib.getDocument() passing the URL of a PDF stored in Salesforce itself, ...
Emmanuel_M's user avatar
1 vote
0 answers
171 views

CORS violation by Aura component

friends. I have some simple aura components that renders a credit card payment form in an iframe. This component works perfectly fine in production but browser fails with same-origin policy error in ...
Vladimir Egikyan's user avatar
1 vote
1 answer
1k views

CORS Issue using Fetch - LWC (PreFlight)

We have a LWC which is being hosted on a VF page using Lightning Out - up until December 2022 it was working without issue but it seems we've run into a CORS issue since then (I assume a Spring ...
cloudcap's user avatar
  • 187
0 votes
0 answers
1k views

Preflight request doesn´t pass access check : It does not have HTTP OK status

When the customer is trying to connect with Salesforce it get Preflight 400 error. Without web-security-disable ON it is working as expected, also in Postman it is working as expected but with web-...
MuhamedH's user avatar
7 votes
1 answer
3k views

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

---------- THE EXPLANATION ---------- I need to use my LWC's in an External Site. For it I use Lightning Out, and I want to test it with Heroku App. I have built a simple Aura Application according to ...
Vitalii Dehnerys's user avatar
0 votes
1 answer
753 views

OAuth 2.0 Web Server Flow and CORS problem

I try to communicate with the API Salesforce. First, I call the URL: https://login.salesforce.com/services/oauth2/authorize. It gives me a code in the callback URL I gave on parameters. Then, I try to ...
SF_user's user avatar
  • 3,646
1 vote
1 answer
28k views

Refused to load script because it violates Content Security Policy directive

I'm currently working to include my external js in aura component. So, i have included my external JS as static resource. but i'm getting the below exception. Refused to load the script '...' because ...
Pavan tej's user avatar
  • 1,458
1 vote
0 answers
475 views

Am I calling my DATABASE_URL correctly with Axios? (CORS error with Heroku Postgres..)

I am trying to deploy an app using a combination of NodeJS, Heroku, and the Postgres add-on database. Everything works fine when I deploy locally. When I try to deploy off of Heroku, however, I get ...
Rob Liou's user avatar
-1 votes
1 answer
787 views

OAuth Error when trying to get Token through JavaScript

I am setting up a connected application and am having trouble generating a bearer token through my JS code. I have it working perfectly through postman, as well as all of my get calls, I use postman ...
David Lascu's user avatar
2 votes
1 answer
342 views

Http CORS violation from Customer Digital Experience

As a dutiful admin, I followed up on the email SFDC sent me entitled Reminder: Get Ready to Enforce the CORS Allowlist for Lightning Apps as my PROD org was mentioned as affected You’re being ...
cropredy's user avatar
  • 72.2k
1 vote
0 answers
176 views

Popup warning that blob cannot be opened because of browser settings when generating data with Javascript

When generating a CSV file with Javascript, and trying to make the file available for download locally, using the snippet below: const blobToBase64 = (blob) => { const reader = new FileReader();...
Renato Oliveira's user avatar
0 votes
1 answer
343 views

LWC Component unable to get response from Nager.Date API although response is shown in network tab

I am unable to get the response from Nager.Date API using the follow code: LWC function: getData(){ let myurl = 'https://date.nager.at/api/v3/publicholidays/2021/AU'; fetch('https://date.nager....
Yjyjyjyj's user avatar
2 votes
1 answer
220 views

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

Few users might be receiving emails as "Get Ready to Enforce the CORS Allowlist for Lightning Apps" stating that their org has one or more external domains calling on Salesforce resources ...
Swetha Maddali's user avatar
0 votes
0 answers
3k views

Origin has been blocked by CORS policy

I understand there are lots of questions and answers related to CORS policy, but here I wanted to make sure if I'm understanding it right and solving it the right way. I have a visualforce page that ...
Adnan Zahry's user avatar
0 votes
1 answer
351 views

Lightning Aura CORS Blocked using JSZip library

I have files on a sharepoint server which I want my lightning aura component to get and download for me. I am using JSZip to zip the files together. As my download function requests the files from the ...
Doodool_Tala's user avatar
0 votes
0 answers
1k views

No 'Access-Control-Allow-Origin' header is present with JavaScript fetch request

I am trying to make this fetch request to the user interface api using react: const newpost = { method: "POST", headers: { Authorization: "Bearer " + this.state.accessToken,...
sgt_pepper85's user avatar
0 votes
2 answers
3k views

Log in to salesforce from a react app

I need to request an authorization code so my application can make a simple request to salesforce. Hitting the url in the article redirects me to the right page where I can grab the code, but I first ...
sgt_pepper85's user avatar
1 vote
1 answer
10k views

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

The developer has included the Web-to-Lead form I have provided in his React - js application. I have enabled the CORS in Salesforce, but the developer is receiving the below error message, when they ...
SSimion's user avatar
  • 139
1 vote
0 answers
125 views

How do i use wordpress navigational menus in salesforce communites site using CMS Connect? Running into CORS and CSP issues

Hey Everyone! I want to use the nav menu from or wordpress site on our salesforce communities based help center using Salesforce CMS connect. But, I am running into some issues that the wider internet ...
Alex's user avatar
  • 11
0 votes
0 answers
1k views

CORS issue while authenticating an external web app to Salesforce

I'm trying to authenticate to saleforce using Connected App and web application, My request succeed with Postman but when I try send the request from the Web App I get CORS issue and OAuth ...
Abderrezak FENOUCHE's user avatar
1 vote
1 answer
2k views

What could cause a static resource to be unavailable on Lightning Community (Experience)?

I have a Lightning Community (Experience) where we are using CMS Connect to pull in a header and footer from a static resource. The resources there are not loading, though. In the Builder tool, they ...
Aidan's user avatar
  • 13.8k
0 votes
2 answers
5k views

CORS issue in LWC

I am testing on Field Service Lightning mobile app LWC pilot feature. Here apex is not supported in Field service mobile with LWC. So, I am trying to make a SF rest resource callout, to get the ...
Hemant Keni's user avatar
0 votes
1 answer
812 views

Enable CORS for Visualforce page

I developed Visualforce page and I want to redirect to external website using apex:actionFunction, every time I execute actionFuncton I got the following error Access to XMLHttpRequest at 'https://...
user1391482's user avatar
2 votes
0 answers
556 views

CORS error loading 3rd party Google API in LWC

I need some help because I'm encountering a CORS error using the Google API javascript library (taken from https://apis.google.com/js/api.js) running inside Lightning Web Components. Error message in ...
Justin Clarke's user avatar
2 votes
1 answer
1k views

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

I'm hoping someone can help me with this as I've been struggling with it for a few days now... Issue: Access to fetch at '[auth url]' from origin 'https://localhost:3000' has been blocked by CORS ...
balwill's user avatar
  • 348
0 votes
1 answer
2k views

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

I am stuck working on a task, I get a same origin policy error : Access to XMLHttpRequest at 'https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8' from origin 'http://localhost' has ...
TaouBen's user avatar
  • 154
3 votes
1 answer
5k views

Call Salesforce API from client side code in Aura/LWC

I want to call Salesforce REST APIs (to the same salesforce org where lightning component is built) from client side JS code in Aura/LWC. I have done some research and thought of this approach. Add ...
Maninder Singh's user avatar
0 votes
0 answers
130 views

How does Salesforce "external services" manage CORS?

I start by testing calling a REST API from Postman : this works. I then set up a Salesforce "External Service" and call the same service from a Flow : this works. Then I create a LWC ...
altius_rup's user avatar
1 vote
0 answers
956 views

Is it possible to return CORS headers (Access-Control-Allow-Origin) on 401 Unauthorized responses?

I've enabled CORS and am using My Domain to successfully make REST API requests from a browser, after getting an Access Token via the User-Agent flow. My goal is to also use the Refresh Token to ...
jon_wu's user avatar
  • 777
1 vote
1 answer
1k views

iframe/embed salesforce into another site

Is this possible to do anymore? I'm trying to iframe Salesforce, in it's entirety for SSO functionality without having the user leave my web application. My application is a connected app and we would ...
Jegsar's user avatar
  • 113
1 vote
1 answer
397 views

Lightning Out/Appointment Scheduling CORB issue

I have an FSL scheduling flow that is on a public community page, and am trying to expose it on an external site via lightning out (https://help.salesforce.com/articleView?id=ls_expose_flow_on_website....
Matt Bratton's user avatar
1 vote
2 answers
2k views

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

What I did Aura Component <aura:component> <lightning:flow aura:id="flowData"/> </aura:component> Controller ({ init: function (component, event, helper) { ...
AjFmO's user avatar
  • 292
0 votes
1 answer
1k views

We added the header Access-Control-Allow-Credentials to true

We load JS code by creating a script tag with dynamic src endpoint and append the script element into the page our src will call resource apex class (@RestResource) I know that Community domain is ...
Mohammed Al-said's user avatar
4 votes
2 answers
965 views

Externally hosted Javascript is unable to access Visualforce page

From my Visualforce page I am calling an externally hosted Javascript app: <apex:page> <apex:iframe src="https://external.com/index.html" id="theFrame" /> </apex:...
Robert Sösemann's user avatar
1 vote
1 answer
207 views

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

We are implamenting a chatbot using the OAuth 2.0 JWT Bearer Token Flow and see the above errors in the browser client degugger. We already have a valid access token and the origin has already been ...
M. Brandel's user avatar
1 vote
0 answers
3k views

Web-to-lead API CORS issue

I am using the We-to-lead form to populate Sales Force, but I would like the form to submit via AJAX rather than default form submission. The default form submission works fine and populates Sales ...
moody1208's user avatar
  • 111
0 votes
0 answers
422 views

CORS wildcard with multi-level subdomains

I'm working through enabling the salesforce embedded login form on a website. I have a test environment for the website that is a bit dynamic and changes with different git branches. For example: ...
bkildow's user avatar
  • 101
1 vote
0 answers
106 views

Authenticate Custom Content Block throws a CORS issue

I'm sitting up the SSO login for my application which is a custom content block by redirecting the user to the link below: var redirectRoute = "https://" + process.env.DEFAULT_BASE_URI + &...
Mohammed Aouladlahcen's user avatar
0 votes
1 answer
4k views

CORS error when calling SF rest api from localhost

I have a small JS application running on localhost. I am getting an access token through the user-agent flow (this works fine). I then make an http request to the identity endpoint to get back my user ...
Greg Grinberg's user avatar
1 vote
0 answers
229 views

CORS problem in Lightning

My Lightning component makes 'GET' callouts for two different URLs of the same service. For one it goes correct each time: https://cors-anywhere.herokuapp.com/https://integration.visma.net/API/...
Ivan Kh's user avatar
  • 41
3 votes
1 answer
817 views

Lightning Out LWC File Not Found?

I know I'm not the first person to ask about this, but I have yet to find a solution to fix it. Problem: I'm receiving a 404 error (file not found) when trying to load a lightning web component via ...
Tom Reinman's user avatar
2 votes
0 answers
508 views

Whitelist ionic://localhost in Salesforce Org for CORS

We are doing REST calls from JavaScript in an IONIC mobile app. Which calls the APIs of Salesforce by using a connected App. On the development machine, we are able to call the standard Salesforce ...
Ashish's user avatar
  • 2,372
1 vote
1 answer
426 views

How to export flow to external website

I am trying to use flow in my local as mentioned here This is how the code looks like: And I'm getting this CORS issue: Access to XMLHttpRequest at 'https://casesrnd-dev-ed.lightning.force.com//...
Ali's user avatar
  • 33