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
157 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-...
user avatar
5 votes
1 answer
321 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 ...
user avatar
0 votes
1 answer
187 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 ...
user avatar
  • 3,536
0 votes
1 answer
3k 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 ...
user avatar
  • 1,456
0 votes
0 answers
30 views

Load a CSV into a Pardot landing page for parsing

I'm trying to do something that may be a little crazy. I want to load a CSV file into a Pardot landing page so that I can parse it and use the data to populate variables on the page based on a query ...
user avatar
  • 1
1 vote
0 answers
232 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 ...
user avatar
-2 votes
1 answer
201 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 ...
user avatar
2 votes
1 answer
127 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 ...
user avatar
  • 63k
0 votes
0 answers
84 views

SFMC- Custom FONT blocked by CORS policy, from rendering in email template on some web browsers

I added a custom font to my marketing email template: @font-face { font-family: 'customfont'; src:url(https://www.examplecustomfonts.com/customfonts/mycustom-webfont.woff2) format('...
user avatar
  • 57
1 vote
0 answers
51 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();...
user avatar
0 votes
1 answer
68 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....
user avatar
2 votes
1 answer
191 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 ...
user avatar
  • 2,832
0 votes
0 answers
870 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 ...
user avatar
0 votes
0 answers
119 views

Suggestion on how to fix CORS error in Lightning Out

I have below vf page in org A. Created an aura app- PublicApp and LWC- cardCmp in org B. Also, I have added entry of org A's domain URL in CORS setting in org B. When I run below VF in org A then I ...
user avatar
  • 1
0 votes
1 answer
152 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 ...
user avatar
0 votes
0 answers
643 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,...
user avatar
0 votes
2 answers
823 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 ...
user avatar
0 votes
1 answer
3k 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 ...
user avatar
  • 119
1 vote
0 answers
56 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 ...
user avatar
  • 11
0 votes
0 answers
119 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 ...
user avatar
1 vote
1 answer
557 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 ...
user avatar
  • 12.9k
0 votes
2 answers
1k 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 ...
user avatar
0 votes
1 answer
242 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://...
user avatar
2 votes
0 answers
255 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 ...
user avatar
1 vote
1 answer
421 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 ...
user avatar
  • 198
0 votes
1 answer
611 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 ...
user avatar
  • 156
0 votes
1 answer
2k 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 ...
user avatar
0 votes
0 answers
72 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 ...
user avatar
1 vote
0 answers
486 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 ...
user avatar
  • 747
1 vote
1 answer
421 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 ...
user avatar
  • 113
1 vote
1 answer
249 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....
user avatar
1 vote
2 answers
755 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) { ...
user avatar
  • 252
1 vote
1 answer
2k views

Using Google Maps API with Lightning Web Components to retrieve Latitude and Longitude - CORS issue

I need to get latitude and longitude results from a text input that takes an address or zipcode. I am trying to do this with Lightning Web Components either using a LWC input with loadScript or ...
user avatar
  • 96
0 votes
1 answer
839 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 ...
user avatar
4 votes
2 answers
602 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:...
user avatar
1 vote
1 answer
148 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 ...
user avatar
1 vote
0 answers
2k 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 ...
user avatar
  • 111
0 votes
0 answers
219 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: ...
user avatar
  • 101
1 vote
0 answers
68 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 + &...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
1 vote
0 answers
124 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/...
user avatar
  • 41
2 votes
1 answer
405 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 ...
user avatar
1 vote
0 answers
298 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 ...
user avatar
  • 2,232
1 vote
1 answer
311 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//...
user avatar
  • 33
3 votes
0 answers
125 views

How to enable CORS in a community

Hi i've recently encountered a problem where i needed CORS to be enabled for some domains. In the Salesforce Org i can specify CORS to be enabled for some domains. The problem lies with community ...
user avatar
  • 243
1 vote
1 answer
607 views

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

Im trying call one endpoint from marketing cloud rest api with AJAX, but im having problems with CORS. This is the error: No 'Access-Control-Allow-Origin' header is present on the requested resource. ...
user avatar
0 votes
1 answer
626 views

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

According to this article, web recommendations can be delivered via JSON response or HTML/JS. It mentions that the JSON response is the best method. However, there is no documentation for getting it. ...
user avatar
  • 101
1 vote
2 answers
212 views

CORS Issue on Personalization Builder output [duplicate]

Our current implementation method uses SFMC's client-side code snippet that returns and places it's HTML in our module and outputs the following on the page: <script src="https://[MID].recs....
user avatar
  • 11
1 vote
1 answer
1k views

I am not able to add the url of my community page to chat with customers section in service console

I am trying to implement chatbot on my community page so when i am trying to add the url into service console's chat with customer section, but it says "Origins may not contain paths or queries, since ...
user avatar
  • 11
0 votes
0 answers
126 views

Content Builder and CORS

I'm trying to force the download of an image, that is hosted in the Content Builder, from a Cloud Page using JS. Everything work properly if I use an image hosted on https://imgur.com/ but if I use ...
user avatar