I have a running instance of a Kylo Sandbox in a server called: kyloserver
. I am trying to access Kylo API from my website, running in localhost:8080
.
I try to use Search API calling url:
http://kyloserver:8400/proxy/v1/feedmgr/search?q=mary&rows=20&start=0
and using Basic Authentication in header like this (javascript):
Authorization: 'Basic ' + btoa(this.username + ":" + this.password)
The response is:
Failed to load http://kyloserver:8400/proxy/v1/feedmgr/search?q=mary&rows=20&start=0: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
If I use swagger by logging into the UI I can get the results properly.
How can I access the API successfully?
(Kylo Version: 0.8.3)
Thanks.
Kylo has disabled CORS support by default. You'll need to write a plugin to override the default configuration with one that enables CORS: https://github.com/Teradata/kylo/blob/v0.8.4/services/service-app/src/main/java/com/thinkbiganalytics/server/DefaultWebSecurityConfigurer.java