I am trying to make sample ajax call to the kibana server running on port 5601 on my local computer.
But I am getting an "Failed to load resource: Preflight response is not successful". I have not enabled any xpack or security packages.
I am trying to do achieve Authentication handshake between the Kibana and localserver with an AJAX call before rendering the data from the kibana.
for now a sample ajax call is giving me preflight error when I am calling from one local server with port 8080 to kibana server port 5601.
Can Anyone help me with this.
Sample Call
var ajaxSuccess = function (response) {
console.log("Success");
};
var ajaxError = function() {
console.log("Error");
};
$.ajax({
type: "POST",
Could you open your browser's developer tools console, networking tab? There should be an OPTIONS request in there. Could you copy/paste the details, specifically the request and response headers, of that request here?
Hmm... looks like you're getting a 404 from the OPTIONS request. I see that the request is being made to http://localhost:5601 with the Access-Control-Request-Method header set to POST. Since http://localhost:5601 does not support POST requests, you are getting a 404 back.
I am trying to do achieve Authentication handshake between the Kibana and localserver with an AJAX call before rendering the data from the kibana.
Could you elaborate on this a bit more? You mentioned that you are not using xpack or any security packages. Does your Kibana instance require authentication some other way?
As of now I am not using any authentication for kibana,just wanted to hit the Kibana and get an success reponse. I am planning to use the authentication once kibana is able to handle the ajax calls.
Also using curl POST command I am able to achieve the success call.
Since http://localhost:5601 does not support POST requests, you are getting a 404 back.
Hi there,
What was the "better way"? Can you tell me please?
I'm trying to use kibana visual, inside my web app but i need to authenticate with ajax call. Same preflight error happens.
There is no way to do so through Ajax call, because when an Ajax call is made for Cross Domain the method type "OPTIONS" is passed to the server and Kibana does not have a way to handle OPTIONS call in there product built code. They gave an option of using proxy server where you can authenticate and pass the request forward, but that still did not work for me as iframe cannot be shared in CROSS Domain.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.