I am using AngularJS to connect to Splunk's REST API, but I am getting
"XMLHttpRequest cannot load https://localhost:8089/services/auth/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access."
Please guide me as I am unable to resolve this. Already read about CORS and added [httpServer]
crossOriginSharingPolicy = http://localhost:8080 to server.conf. Also please suggest if something more has to be done.
I am deploying the application on Tomcat and Splunkd is running on default port 8089 (OS:Win7).
I tried it from Java console application and it works like butter.. Kindly help me out with the error.
There are two probable solutions to this problem. First of all this is CORS problem, means the browser will stop the request to send the request to Splunk server as the splunk is not authorized to response to different domains.
You have to add the Allow-Control headers in splunk, check out server.conf and web.conf. for documentation.
If you want to bypass the splunk config , and don't want to touch the web.conf files , then make a local request to application server and from there you can make a request to Splunk server. You will by pass the browser restrictions.Also you have to keep in mind that your management port is running on valid certificate ,otherwise at the application server side of your application you have to allow the unsecure connections(I got the same problem when i was connecting from node).