Skip to main content
SIDDHARTH_AGRAWAL
Feb 11, 2022 11:35 AM UTC
Question

CORS/CORB/Site Isolation issue in an API call

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
Jan 9, 2023 6:04 AM UTC

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
Mar 30, 2023 6:55 AM UTC

Any update on this?

Corey_O_Brien
Active Member
May 4, 2023 5:27 PM UTC

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

jak_e
Figmate
Figmate
May 4, 2023 7:24 PM UTC

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 3:19 AM UTC

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

Gleb
Power Member
May 14, 2023 3:56 AM UTC

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 12:08 AM UTC

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 6:05 AM UTC

Can you show the full request code?

Corey_O_Brien
Active Member
Jul 13, 2023 9:47 PM UTC

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
Oct 9, 2024 5:58 AM UTC

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.