<?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: Splunk session key usage in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-session-key-usage/m-p/388890#M69612</link>
    <description>&lt;P&gt;Any help here team?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 20:37:47 GMT</pubDate>
    <dc:creator>mishiehow</dc:creator>
    <dc:date>2019-02-19T20:37:47Z</dc:date>
    <item>
      <title>Splunk session key usage</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-session-key-usage/m-p/388889#M69611</link>
      <description>&lt;P&gt;HI Team,&lt;/P&gt;

&lt;P&gt;I am having a hard time getting a response from splunk enterprise server.&lt;BR /&gt;
Here is my use case- I have a rest url for splunk-&lt;BR /&gt;
&lt;A href="https://splunk-cto-prd-search-rest.platform.intuit.net/services/search/jobs/export" target="_blank"&gt;https://splunk-cto-prd-search-rest.platform.intuit.net/services/search/jobs/export&lt;/A&gt; which requires a custom PrivateAuth using an authorization header. Since this endpoint sits behind a firewall or is on internal company's network, team exposed a diff open gateway url -&lt;BR /&gt;
&lt;A href="https://splunkcto.api.intuit.com/services/search/jobs" target="_blank"&gt;https://splunkcto.api.intuit.com/services/search/jobs&lt;/A&gt;&lt;BR /&gt;
The prob is that using just Private Auth headers is not enough as we need some user id/pwd authentication too.&lt;/P&gt;

&lt;P&gt;So, I first make the call to &lt;A href="https://splunkcto.api.intuit.com/services/auth/login" target="_blank"&gt;https://splunkcto.api.intuit.com/services/auth/login&lt;/A&gt; to get a session key.&lt;BR /&gt;
Then pass the session key in the header for this call- &lt;A href="https://splunkcto.api.intuit.com/services/search/jobs" target="_blank"&gt;https://splunkcto.api.intuit.com/services/search/jobs&lt;/A&gt; but I end up getting 401 Unauthorized. The prob is that my request is not reaching our gateways when I try these calls from Postman. &lt;BR /&gt;
Help get unblocked please.&lt;/P&gt;

&lt;P&gt;I saw the java code sample/python ones too, which you have. I see everywhere they say pass session key in header but that is not working.&lt;BR /&gt;
In this post for the java sdk example, &lt;A href="https://answers.splunk.com/answers/240878/java-sdk-connect-with-sessionkey.html" target="_blank"&gt;https://answers.splunk.com/answers/240878/java-sdk-connect-with-sessionkey.html&lt;/A&gt;&lt;BR /&gt;
My question is exactly the same. I see Service.login() and then setting of token in Service.setToken(String token)method. Nowhere is the sessionToken used from login call. How does this work?&lt;/P&gt;

&lt;P&gt;Here are my requests-&lt;BR /&gt;
curl -X POST \&lt;BR /&gt;
  &lt;A href="https://splunkcto.api.intuit.com/services/auth/login" target="_blank"&gt;https://splunkcto.api.intuit.com/services/auth/login&lt;/A&gt; \&lt;BR /&gt;
  -H 'Authorization: Intuit_IAM_Authentication intuit_appid= * ,intuit_app_secret=*' \&lt;BR /&gt;
  -H 'Content-Type: application/x-www-form-urlencoded' \&lt;BR /&gt;
  -H 'Postman-Token: 92b955bd-2d36-4147-a316-da48beee5c93' \&lt;BR /&gt;
  -H 'cache-control: no-cache'&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;sessionKey&amp;gt;PGy1TOEhKIjC2Znp9J33R8oxthtTXKrzQeU_qlrOBhfFcHQkby9tYnuNBXcnR8AtMLLsJJc6gRto6L_tE7iXt^SoFO3r6TPebed45y^RHdBqTgh0buTIH671UC986JIF6r7&amp;lt;/sessionKey&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then second call-&lt;BR /&gt;
url -X POST \&lt;BR /&gt;
  &lt;A href="https://splunkcto.api.intuit.com/services/search/jobs" target="_blank"&gt;https://splunkcto.api.intuit.com/services/search/jobs&lt;/A&gt; \&lt;BR /&gt;
  -H 'Authorization: Splunk PGy1TOEhKIjC2Znp9J33R8oxthtTXKrzQeU_qlrOBhfFcHQkby9tYnuNBXcnR8AtMLLsJJc6gRto6L_tE7iXt^SoFO3r6TPebed45y^RHdBqTgh0buTIH671UC986JIF6r7' \&lt;BR /&gt;
  -H 'Content-Type: application/x-www-form-urlencoded' \&lt;BR /&gt;
  -H 'Postman-Token: d7ef70d7-4f1e-4c47-8eac-25a2098d1b6c' \&lt;BR /&gt;
  -H 'cache-control: no-cache' \&lt;BR /&gt;
  -d 'output_mode=json&amp;amp;earliest_time=-1m&amp;amp;latest_time=now&amp;amp;search=search%20index%3D*acc*%20statusCode!%3D200%20intuit_tid%3D41204da5-1fed-65ac-b99e-0ca800d83da5%20%7C%20head%201%20%7C%20fields%20*&amp;amp;undefined='&lt;/P&gt;

&lt;P&gt;The second calls fails everytime. &lt;/P&gt;

&lt;P&gt;I do see intuit_tid →4119197e-6a6f-8183-b983-3a85eca9f063&lt;BR /&gt;
WWW-Authenticate →Bearer realm="Intuit" returned in response but if I try searching my gateway logs, I can't find anything, so there is defi something blocking my calls even before it hits my splunk gateway url- &lt;A href="https://splunkcto.api.intuit.com" target="_blank"&gt;https://splunkcto.api.intuit.com&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-session-key-usage/m-p/388889#M69611</guid>
      <dc:creator>mishiehow</dc:creator>
      <dc:date>2020-09-29T23:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk session key usage</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-session-key-usage/m-p/388890#M69612</link>
      <description>&lt;P&gt;Any help here team?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 20:37:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-session-key-usage/m-p/388890#M69612</guid>
      <dc:creator>mishiehow</dc:creator>
      <dc:date>2019-02-19T20:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk session key usage</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-session-key-usage/m-p/388891#M69613</link>
      <description>&lt;P&gt;This is a case for @Damien Dallimore &lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 19:39:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-session-key-usage/m-p/388891#M69613</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-28T19:39:30Z</dc:date>
    </item>
  </channel>
</rss>

