<?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: Getting &amp;quot;Unauthorised&amp;quot; response from API - querying KV Store in Security</title>
    <link>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157880#M4730</link>
    <description>&lt;P&gt;Valid point - however can confirm this  is not the issue here. The password has only alpha-numeric chars&lt;/P&gt;</description>
    <pubDate>Mon, 27 Apr 2015 16:25:24 GMT</pubDate>
    <dc:creator>himynamesdave</dc:creator>
    <dc:date>2015-04-27T16:25:24Z</dc:date>
    <item>
      <title>Getting "Unauthorised" response from API - querying KV Store</title>
      <link>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157878#M4728</link>
      <description>&lt;P&gt;Happy Monday everyone!&lt;/P&gt;

&lt;P&gt;I am trying to query collections in my app using the API like so (note, I am using a different password for admin):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:changeme "https://0.0.0.0:8089/servicesNS/nobody/MYAPP/storage/collections/config"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the following response.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;messages&amp;gt;
    &amp;lt;msg type="ERROR"&amp;gt;Unauthorized&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using admin account which has read and write permissions for MYAPP.&lt;/P&gt;

&lt;P&gt;UPDATE: I think this may be an API permission issue to MYAPP. So, if I run the same query on the search app (without any collections created) I get a valid response, i.e:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:changeme "https://0.0.0.0:8089/servicesNS/nobody/search/storage/collections/config"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As soon as I create a collection in the search app, I then get the unauthorised response again. Argh!&lt;/P&gt;

&lt;P&gt;Then I thought it my be an issue running it as nobody, or admin on the collections. So I explicitly set owner=nobody in MYAPP/metadata/local for each collection. Still fail.&lt;/P&gt;

&lt;P&gt;UPDATE: my collections.conf is very basic&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myfirstcollection]

[mysecondcollection]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In transforms I use these for a lookup for searching:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[kvstore_myfirst_lookup]
external_type = kvstore
collection = myfirstcollection
fields_list = _key, firstKV

[kvstore_second_lookup]
external_type = kvstore
collection = mysecondcollection
fields_list = _key, secondKV
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I cannot find what permissions I need to set in my app to make this work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Any ideas? &lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2015 11:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157878#M4728</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2015-04-27T11:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Unauthorised" response from API - querying KV Store</title>
      <link>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157879#M4729</link>
      <description>&lt;P&gt;make sure you escape special chars in your password!!!&lt;/P&gt;

&lt;P&gt;for example:&lt;/P&gt;

&lt;P&gt;admin:P@ssword$&lt;/P&gt;

&lt;P&gt;this password would need a backslash in front of the @ and $&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2015 12:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157879#M4729</guid>
      <dc:creator>n00badmin</dc:creator>
      <dc:date>2015-04-27T12:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Unauthorised" response from API - querying KV Store</title>
      <link>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157880#M4730</link>
      <description>&lt;P&gt;Valid point - however can confirm this  is not the issue here. The password has only alpha-numeric chars&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2015 16:25:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157880#M4730</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2015-04-27T16:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Unauthorised" response from API - querying KV Store</title>
      <link>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157881#M4731</link>
      <description>&lt;P&gt;what does your collections.conf look like ?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 01:43:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157881#M4731</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2015-04-28T01:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Unauthorised" response from API - querying KV Store</title>
      <link>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157882#M4732</link>
      <description>&lt;P&gt;I've added an update to the Q to include collections / transforms.conf info&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 07:38:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157882#M4732</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2015-04-28T07:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Unauthorised" response from API - querying KV Store</title>
      <link>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157883#M4733</link>
      <description>&lt;P&gt;I didn't manage to solve why that endpoint returned the "unauth" response, but for those who stumble upon this question with the same issue I did find a workaround that may be useful.&lt;/P&gt;

&lt;P&gt;For my use-case I did not really need a list of all collections, as the endpoint (/servicesNS/nobody/MYAPP/storage/collections/config) gives.&lt;/P&gt;

&lt;P&gt;What I needed was to print the contents of the collection. I could do this, by querying a different endpoint like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:changeme &lt;A href="https://0.0.0.0:8089/servicesNS/nobody/MYAPP/storage/collections/data/MYCOLLECTION" target="test_blank"&gt;https://0.0.0.0:8089/servicesNS/nobody/MYAPP/storage/collections/data/MYCOLLECTION&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Apr 2015 19:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Getting-quot-Unauthorised-quot-response-from-API-querying-KV/m-p/157883#M4733</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2015-04-28T19:57:45Z</dc:date>
    </item>
  </channel>
</rss>

