<?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: Using the AUTH LOGIN sessionkey with Curl SplunkAPI in Security</title>
    <link>https://community.splunk.com/t5/Security/Using-the-AUTH-LOGIN-sessionkey-with-Curl-SplunkAPI/m-p/47629#M13879</link>
    <description>&lt;P&gt;Finally found an example on &lt;A href="http://stackoverflow.com/questions/3044315/how-to-set-the-authorization-header-using-curl"&gt;http://stackoverflow.com/questions/3044315/how-to-set-the-authorization-header-using-curl&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Turns out I was missing the space after the -H&lt;BR /&gt;
curl -H "Authorization: OAuth &lt;ACCESS_TOKEN&gt;" &lt;A href="http://www.example.com"&gt;http://www.example.com&lt;/A&gt;&lt;/ACCESS_TOKEN&gt;&lt;/P&gt;

&lt;P&gt;I hope this helps any new to this like I am!&lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2012 20:56:21 GMT</pubDate>
    <dc:creator>admoseley</dc:creator>
    <dc:date>2012-05-10T20:56:21Z</dc:date>
    <item>
      <title>Using the AUTH LOGIN sessionkey with Curl SplunkAPI</title>
      <link>https://community.splunk.com/t5/Security/Using-the-AUTH-LOGIN-sessionkey-with-Curl-SplunkAPI/m-p/47628#M13878</link>
      <description>&lt;P&gt;I can successfully get a session key and capture it into a variable.. (using powershell)&lt;BR /&gt;
What is the syntax for using the sessionkey to authenticate if I wanted to follow with a search command?&lt;/P&gt;

&lt;P&gt;EX:&lt;BR /&gt;
PS C:\Program Files\curl&amp;gt; [xml]$AuthKey = .\curl.exe -k &lt;A href="https://splunkapi.localhost.com:8089/servicesNS/admin" target="_blank"&gt;https://splunkapi.localhost.com:8089/servicesNS/admin&lt;/A&gt;&lt;BR /&gt;
/search/auth/login/ -d"username=username1" -d"password=password1"&lt;BR /&gt;
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current&lt;BR /&gt;
                                 Dload  Upload   Total   Spent    Left  Speed&lt;BR /&gt;
100   118  100    80  100    38    146     69 --:--:-- --:--:-- --:--:--   146&lt;BR /&gt;
PS C:\Program Files\curl&amp;gt; $AuthKey.response.sessionKey&lt;BR /&gt;
a72889e1846e16be2a2e0e707afcb2b6&lt;/P&gt;

&lt;P&gt;I've looked at this but I see no specific example of the sessionkey being used.&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/rest-api-overview/SP-CAAADP8" target="_blank"&gt;http://dev.splunk.com/view/rest-api-overview/SP-CAAADP8&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I've attempted several variations like this:&lt;BR /&gt;
PS C:\Program Files\curl&amp;gt;  .\curl -k &lt;A href="https://splunkapi.localhost.com:8089/servicesNS/username/search/search/jobs" target="_blank"&gt;https://splunkapi.localhost.com:8089/servicesNS/username/search/search/jobs&lt;/A&gt; -H"Authorization: Splunk $AuthKey.response.sessionKey" --data-urlencode search="|savedsearch test_saved_search"&lt;/P&gt;

&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:47:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Using-the-AUTH-LOGIN-sessionkey-with-Curl-SplunkAPI/m-p/47628#M13878</guid>
      <dc:creator>admoseley</dc:creator>
      <dc:date>2020-09-28T11:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using the AUTH LOGIN sessionkey with Curl SplunkAPI</title>
      <link>https://community.splunk.com/t5/Security/Using-the-AUTH-LOGIN-sessionkey-with-Curl-SplunkAPI/m-p/47629#M13879</link>
      <description>&lt;P&gt;Finally found an example on &lt;A href="http://stackoverflow.com/questions/3044315/how-to-set-the-authorization-header-using-curl"&gt;http://stackoverflow.com/questions/3044315/how-to-set-the-authorization-header-using-curl&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Turns out I was missing the space after the -H&lt;BR /&gt;
curl -H "Authorization: OAuth &lt;ACCESS_TOKEN&gt;" &lt;A href="http://www.example.com"&gt;http://www.example.com&lt;/A&gt;&lt;/ACCESS_TOKEN&gt;&lt;/P&gt;

&lt;P&gt;I hope this helps any new to this like I am!&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2012 20:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Using-the-AUTH-LOGIN-sessionkey-with-Curl-SplunkAPI/m-p/47629#M13879</guid>
      <dc:creator>admoseley</dc:creator>
      <dc:date>2012-05-10T20:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using the AUTH LOGIN sessionkey with Curl SplunkAPI</title>
      <link>https://community.splunk.com/t5/Security/Using-the-AUTH-LOGIN-sessionkey-with-Curl-SplunkAPI/m-p/47630#M13880</link>
      <description>&lt;P&gt;curl -k -u admin:changeme  &lt;A href="https://foobar:8101/services/auth/login"&gt;https://foobar:8101/services/auth/login&lt;/A&gt; -d username=admin -d password=changeme&lt;BR /&gt;
&lt;RESPONSE&gt;&lt;BR /&gt;
  &lt;SESSIONKEY&gt;2b8868fe198cf1203256e6af6515bfad&lt;/SESSIONKEY&gt;&lt;BR /&gt;
&lt;/RESPONSE&gt;&lt;BR /&gt;
curl -k -H "Authorization: Splunk 2b8868fe198cf1203256e6af6515bfad" &lt;A href="https://foobar:8101/services/search/jobs"&gt;https://foobar:8101/services/search/jobs&lt;/A&gt; | less&lt;/P&gt;

&lt;P&gt;succeeds... OUTPUT below&lt;/P&gt;

&lt;P&gt;0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;
&amp;lt;!--This is to override browser formatting; see server.conf[httpServer] to disable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .--&amp;gt;&lt;BR /&gt;
&amp;lt;?xml-stylesheet type="text/xml" href="/static/atom.xsl"?&amp;gt;&lt;BR /&gt;
&lt;FEED xmlns="http://www.w3.org/2005/Atom" S="http://dev.splunk.com/ns/rest" OPENSEARCH="http://a9.com/-/spec/opensearch/1.1/"&gt;&lt;BR /&gt;
  &lt;TITLE&gt;jobs&lt;/TITLE&gt;&lt;BR /&gt;
  &lt;ID&gt;&lt;A href="https://foobar:8101/services/search/jobs"&gt;https://foobar:8101/services/search/jobs&lt;/A&gt;&lt;/ID&gt;&lt;BR /&gt;
  &lt;UPDATED&gt;2014-02-11T10:13:55-08:00&lt;/UPDATED&gt;&lt;BR /&gt;
  &lt;GENERATOR build="196612" version="20140210"&gt;&lt;/GENERATOR&gt;&lt;BR /&gt;
  &lt;AUTHOR&gt;&lt;BR /&gt;
    &lt;NAME&gt;Splunk&lt;/NAME&gt;&lt;BR /&gt;
  &lt;/AUTHOR&gt;&lt;BR /&gt;
  &lt;A href="opensearch:totalResults"&gt;opensearch:totalResults&lt;/A&gt;7&lt;A href="https://answers.splunk.comopensearch:totalResults"&gt;/opensearch:totalResults&lt;/A&gt;&lt;BR /&gt;
  &lt;A href="opensearch:itemsPerPage"&gt;opensearch:itemsPerPage&lt;/A&gt;0&lt;A href="https://answers.splunk.comopensearch:itemsPerPage"&gt;/opensearch:itemsPerPage&lt;/A&gt;&lt;BR /&gt;
  &lt;A href="opensearch:startIndex"&gt;opensearch:startIndex&lt;/A&gt;0&lt;A href="https://answers.splunk.comopensearch:startIndex"&gt;/opensearch:startIndex&lt;/A&gt;&lt;BR /&gt;
{snipped}&lt;/FEED&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 18:15:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Using-the-AUTH-LOGIN-sessionkey-with-Curl-SplunkAPI/m-p/47630#M13880</guid>
      <dc:creator>arahut_splunk</dc:creator>
      <dc:date>2014-02-11T18:15:20Z</dc:date>
    </item>
  </channel>
</rss>

