Cross Origin Access Issue

Hey! i am new to Auth0 community. I was facing an issue in sending a simple api request on a different domain and getting following error. The api request working correctly in the postman but not working in browser.

image

I am already setting cross-origin request true in my header but still getting the error. Here is a snippet of my api call.
image
Also i thought it might be an server side issue so i changed allowed origins to https://* but still didn’t work. Does any one faced the similar issue and know any clue to solve it?

It was a region issue. I simply added proxy url and it worked. Here is my code.

var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer "+ token);

var requestOptions = {

method: 'GET',
headers: myHeaders,
Vary: 'Origin',
};
const proxyurl = "https://cors-anywhere.herokuapp.com/";
const url = "your url";

fetch(proxyurl + url, requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
1 Like

Perfect! Glad to hear that and thanks for sharing with the rest of community!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.