<?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: Not able to authenticate Splunk REST API with Postman in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/445046#M77486</link>
    <description>&lt;P&gt;@spammenot66, following is what I had tried for HEC using JSON Data packet. I had to use &lt;CODE&gt;http&lt;/CODE&gt; on my local, however, https should work if cURL worked fine for you.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://wiki.splunk.com/User_talk:Niketnilay#Topic_5:_HTTP_Event_Collector_.28HEC.29_in_Windows_using_cURL_with_Postman"&gt;https://wiki.splunk.com/User_talk:Niketnilay#Topic_5:_HTTP_Event_Collector_.28HEC.29_in_Windows_using_cURL_with_Postman&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jul 2018 17:39:47 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-07-16T17:39:47Z</dc:date>
    <item>
      <title>Not able to authenticate Splunk REST API with Postman</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/445045#M77485</link>
      <description>&lt;P&gt;I'm able to confirm this works for me curl command is working for me. It returns a session ID. &lt;BR /&gt;
curl -k &lt;A href="https://splunkdomain.local:8089/services/auth/login"&gt;https://splunkdomain.local:8089/services/auth/login&lt;/A&gt; --data-urlencode username={username} --data-urlencode password={password}&lt;/P&gt;

&lt;P&gt;Using the same end point in Postman, it complains "Login failed". Can someone please assist? &lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5382i87AD674D21FC1FFB/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 11:02:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/445045#M77485</guid>
      <dc:creator>spammenot66</dc:creator>
      <dc:date>2018-07-16T11:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to authenticate Splunk REST API with Postman</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/445046#M77486</link>
      <description>&lt;P&gt;@spammenot66, following is what I had tried for HEC using JSON Data packet. I had to use &lt;CODE&gt;http&lt;/CODE&gt; on my local, however, https should work if cURL worked fine for you.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://wiki.splunk.com/User_talk:Niketnilay#Topic_5:_HTTP_Event_Collector_.28HEC.29_in_Windows_using_cURL_with_Postman"&gt;https://wiki.splunk.com/User_talk:Niketnilay#Topic_5:_HTTP_Event_Collector_.28HEC.29_in_Windows_using_cURL_with_Postman&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 17:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/445046#M77486</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-16T17:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to authenticate Splunk REST API with Postman</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/506792#M86257</link>
      <description>&lt;P&gt;Im stuck on the same issue, but if you look closely its not an AUTH falied, it is really a &lt;STRONG&gt;400 Bad Request&lt;/STRONG&gt; error, I'v been trying different ways to call the API on Postman but so far I haven't been able to get it working, but it works on cURL and using Requests on Python, so its definitively something related to the message formatting that is causing this.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 21:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/506792#M86257</guid>
      <dc:creator>Chepech</dc:creator>
      <dc:date>2020-06-30T21:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to authenticate Splunk REST API with Postman</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/506795#M86258</link>
      <description>&lt;P&gt;So this is what I did to solve it... I noticed that the cURL generated by postman was not working and getting the exact same error you are seeing on the UI, this cURL command looks something like:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;DIV&gt;&lt;SPAN&gt;curl&amp;nbsp;--location&amp;nbsp;--request&amp;nbsp;POST -k&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'https://{{host}}:8089/services/auth/login'&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;--data-urlencode&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'username={{user}}'&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;--data-urlencode&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'password={{password}}'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;So What I did was:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go into Postman and click IMPORT&lt;/LI&gt;&lt;LI&gt;On the import Dialog go to the RAW Text tab and paste this:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;&lt;LI-SPOILER&gt;curl -k https://{{host}}:8089/services/auth/login --data-urlencode username={{user}} --data-urlencode password={{pass}}&lt;/LI-SPOILER&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;And hit IMPORT, this will generate a working request. If you look at the cURL generated by it the only difference is that it actually sets the&amp;nbsp;&lt;SPAN&gt;Content-Type header which seems to so the trick. It now looks something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;curl --location --request POST -k 'https://{{host}}:8089/services/auth/login' \&lt;BR /&gt;--header 'Content-Type: application/x-www-form-urlencoded' \&lt;BR /&gt;--data-urlencode 'username={{user}}' \&lt;BR /&gt;--data-urlencode 'password={{pass}}'&lt;/LI-SPOILER&gt;&lt;P&gt;Trying this curl command on the terminal will also work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 22:04:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-authenticate-Splunk-REST-API-with-Postman/m-p/506795#M86258</guid>
      <dc:creator>Chepech</dc:creator>
      <dc:date>2020-06-30T22:04:55Z</dc:date>
    </item>
  </channel>
</rss>

