Hello, Iโm trying to use the API to make a request from the browser.
Unfortunately the request gets blocked by CORS.
When I make the request from shell it works fine but since the browser sends the options preflight first the server doesnโt accept it.
Is there a way around this or can I whitelist the origin?
fetch('https://INSTANCE_ID.looker.com:19999/api/3.1/user', {
method: 'GET',
headers: new Headers({
'Authorization': 'token xxx'
})
});
Access to fetch at โhttps://xxx.looker.com:19999/api/3.1/userโ from origin โhttps://localhost:3333โ has been blocked by CORS policy: Response to preflight request doesnโt pass access control check: No โAccess-Control-Allow-Originโ header is present on the requested resource. If an opaque response serves your needs, set the requestโs mode to โno-corsโ to fetch the resource with CORS disabled.
Hey Jos, welcome ๐
This is expected behavior right now, and thereโs no way to whitelist AFAIK. Weโre actively working on CORS support but itโs not released yet so for now, all browser-based API calls are going to fail.
Hello, any news on this subject? How can we bypass this issue? Is there an ETA to solve it?
Hello,
How can we bypass the CORS issue when trying from our local system? Any help is highly appreciated.
Regards
Hello, is there any workaround for this? Iโm kinda having the same issue.
Thanks!
API CORS support was added in Looker 7.10 and made GA in Looker 7.14. To resolve this error, youโll need to add your appโs domain to the Embedded Domain Allowlist.