1

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.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Israel Varea
  • 2,600
  • 2
  • 17
  • 24

2 Answers2

1

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

Greg Hart
  • 386
  • 1
  • 4
  • Thanks! Does it make sense to open an issue and suggest to be able to enable CORS from config i.e. application.properties?? – Israel Varea Dec 01 '17 at 08:54
  • Yes, you can open a JIRA. Then the Kylo team can decide how to proceed. https://kylo-io.atlassian.net/ – Greg Hart Dec 07 '17 at 19:47
0

Finally I decided to create a Proxy web service which is hosted in the same server as Kylo, which just redirects the requests from the web to the Kylo Service.

Israel Varea
  • 2,600
  • 2
  • 17
  • 24