<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SplunkJS SDK: Getting error &amp;quot;Request header field X-Splunk-Form-Key is not allowed by Access-Control-Allow-Headers&amp;quot; after migrating to 6.5.x in Security</title>
    <link>https://community.splunk.com/t5/Security/SplunkJS-SDK-Getting-error-quot-Request-header-field-X-Splunk/m-p/225007#M6366</link>
    <description>&lt;P&gt;Looking at the splunkjs code I found the "SplunkWebHttp" which seems to be using the standard " /splunkd/__raw" path.&lt;BR /&gt;
Replacing the line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.JQueryHttp();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.SplunkWebHttp();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Solved the issue.&lt;/P&gt;

&lt;P&gt;I couldn't find any documentation about this. Seems all samples assume you want to use a proxy server. &lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2017 14:46:10 GMT</pubDate>
    <dc:creator>mgarciar</dc:creator>
    <dc:date>2017-01-11T14:46:10Z</dc:date>
    <item>
      <title>SplunkJS SDK: Getting error "Request header field X-Splunk-Form-Key is not allowed by Access-Control-Allow-Headers" after migrating to 6.5.x</title>
      <link>https://community.splunk.com/t5/Security/SplunkJS-SDK-Getting-error-quot-Request-header-field-X-Splunk/m-p/225006#M6365</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;

&lt;P&gt;I have a custom web page calling Splunk services using SplunkJS SDK. After migrating to 6.5, the page started failing with this message:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;XMLHttpRequest cannot load &lt;A href="https://(hostname):(port)/services/auth/login?output_mode=json" target="test_blank"&gt;https://(hostname):(port)/services/auth/login?output_mode=json&lt;/A&gt;. Request header field X-Splunk-Form-Key is not allowed by Access-Control-Allow-Headers. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The code is the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;function getJSONConnectionParams(username,password,hostname){
     return JSON.parse('{"username":"'+username+'","password":"'+password+'","scheme":"https","host":"'+hostname+'","port":8089}');
}

var http = new splunkjs.JQueryHttp();
var service = new splunkjs.Service(http,getJSONConnectionParams(splunkCurrentUser,currentPassword,getHostName()));

service.login(function(err) { ... }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The error shows up when the login function is called. &lt;/P&gt;

&lt;P&gt;Splunk Web UI and Management port are using HTTPS, both certificates are the same. Also the crossOriginReference is enabled on the server.conf file. &lt;/P&gt;

&lt;P&gt;Any help will be appreciated. &lt;/P&gt;

&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 04:29:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/SplunkJS-SDK-Getting-error-quot-Request-header-field-X-Splunk/m-p/225006#M6365</guid>
      <dc:creator>mgarciar</dc:creator>
      <dc:date>2017-01-10T04:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS SDK: Getting error "Request header field X-Splunk-Form-Key is not allowed by Access-Control-Allow-Headers" after migrating to 6.5.x</title>
      <link>https://community.splunk.com/t5/Security/SplunkJS-SDK-Getting-error-quot-Request-header-field-X-Splunk/m-p/225007#M6366</link>
      <description>&lt;P&gt;Looking at the splunkjs code I found the "SplunkWebHttp" which seems to be using the standard " /splunkd/__raw" path.&lt;BR /&gt;
Replacing the line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.JQueryHttp();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.SplunkWebHttp();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Solved the issue.&lt;/P&gt;

&lt;P&gt;I couldn't find any documentation about this. Seems all samples assume you want to use a proxy server. &lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 14:46:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/SplunkJS-SDK-Getting-error-quot-Request-header-field-X-Splunk/m-p/225007#M6366</guid>
      <dc:creator>mgarciar</dc:creator>
      <dc:date>2017-01-11T14:46:10Z</dc:date>
    </item>
  </channel>
</rss>

