Skip to main content
SIDDHARTH_AGRAWAL
February 11, 2022
Question

CORS/CORB/Site Isolation issue in an API call

  • February 11, 2022
  • 11 replies
  • 2442 views

I am calling a POST API for OAuth authentication which is blocked by the google chrome browser, looks like the issue is of site isolation/CORB.

While the same request is being properly at the network level (checked in fiddler and postman).

This topic has been closed for replies.

11 replies

Corey_O_Brien
Active Member
January 9, 2023

Anyone solved this? I am unable to use the OATH method for Figma API because of CORS. Is there something I can do to fix this? I am using https with my server and still no luck. I thought you could connect to an API outside of you server and not get the CORS error.

srigar_sri
March 30, 2023

Any update on this?

Corey_O_Brien
Active Member
May 4, 2023

Nope :(. Nothing that I have seen. Still a problem.

jak_e
Figmate
Figmate
May 4, 2023

Hey, sorry to hear y’all are blocked by this. Can we get a screenshot of the chrome warning and/or some steps to reproduce?

Corey_O_Brien
Active Member
May 14, 2023

Here is what it looks like for me even though I enabled CORS headers on the server 😦

Gleb
Power Member
May 14, 2023

Are you trying to use this inside of the plugin window? This isn’t possible as the plugin iframe always has the null origin. Here is how you are supposed to do this:

figma.com
Corey_O_Brien
Active Member
May 17, 2023

Nope, I am using it with a VueJS application using axios. I tried doing headers on my web server and tried using proxies, but nothing has worked.

Gleb
Power Member
May 17, 2023

Can you show the full request code?

Corey_O_Brien
Active Member
July 13, 2023

What code are you asking for? You want to see my code that calls the API? It is a simple axios get call.

async fetchComments() {
console.log(‘fetching comments’);
this.loading = true;
try {
const headers = {
Authorization: 'Bearer ’ + this.txtApiKey,
};
const res = await axios.get(‘https://api.figma.com/v1/files/’ + this.ddFiles + ‘/comments’, {
headers,
});
this.figmaComments = res.data.comments;

			// Set chose file in local storage. To be used later when we want to show file information on the home page.
			localStorage.setItem('ddFiles', this.ddFiles);

			// Close the modal after selecting the file to see comments for.
			let modalToClose: any = this.$refs.closeSetFigmaCredentials;
			modalToClose.click();
		} catch (error) {
			this.errorMessage = 'An error has occured whle loading the comments.';
		} finally {
			this.loading = false;
		}
	},
Corey_O_Brien
Active Member
October 9, 2024

I am still facing this issue. I am making a web page that brings up all of my file’s comments. When I do this, using the Figma API, it, of course, considers that CORS and blocks it in my browser unless I start the browser in no security mode. Is there a way to make a call to the Figma API from a website (different domain) without getting the CORS issue? Is there a proxy or other mechanism that I can use to bypass this? @jak_e you asked me about it but I didn’t see a response.