<?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: Why does creating a user with multiple roles fail when calling the REST API endpoint from curl? in Security</title>
    <link>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297128#M7946</link>
    <description>&lt;P&gt;awesome! I'll update the docs to mention this. Will convert my comment to an answer as it solved your question. Please feel free to accept it! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2017 00:37:28 GMT</pubDate>
    <dc:creator>frobinson_splun</dc:creator>
    <dc:date>2017-05-17T00:37:28Z</dc:date>
    <item>
      <title>Why does creating a user with multiple roles fail when calling the REST API endpoint from curl?</title>
      <link>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297125#M7943</link>
      <description>&lt;P&gt;I can successfully create users by calling the REST API authentication/users endpoint from curl, but when I try to create a user with multiple roles it fails.&lt;/P&gt;

&lt;P&gt;For example, this command will successfully create a user:&lt;BR /&gt;
curl -k -s -u admin:changeme &lt;A href="https://splunk1:8089/services/authentication/users"&gt;https://splunk1:8089/services/authentication/users&lt;/A&gt; -d name=test1 -d password=test1 -d realname="Test User 1" -d email=&lt;A href="mailto:test1@here.com"&gt;test1@here.com&lt;/A&gt; -d &lt;STRONG&gt;roles="role1"&lt;/STRONG&gt; -d defaultApp=search&lt;/P&gt;

&lt;P&gt;However, when I try to specify multiple roles as shown below the command fails. I have tried using a blank, comma and a comma/blank as delimiters between the role names and none of them work.&lt;BR /&gt;
curl -k -s -u admin:changeme &lt;A href="https://splunk1:8089/services/authentication/users"&gt;https://splunk1:8089/services/authentication/users&lt;/A&gt; -d name=test1 -d password=test1 -d realname="Test User 1" -d email=&lt;A href="mailto:test1@here.com"&gt;test1@here.com&lt;/A&gt; -d &lt;STRONG&gt;roles="role1,role2"&lt;/STRONG&gt; -d defaultApp=search&lt;/P&gt;

&lt;P&gt;The REST API documentation for the authentication/users endpoint says that the roles parameter should contain "One or more existing roles to assign to this user."&lt;/P&gt;

&lt;P&gt;What syntax should I use for specifying multiple roles when creating a user with the REST API?&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 20:22:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297125#M7943</guid>
      <dc:creator>rpwawa</dc:creator>
      <dc:date>2017-05-16T20:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does creating a user with multiple roles fail when calling the REST API endpoint from curl?</title>
      <link>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297126#M7944</link>
      <description>&lt;P&gt;Hi @rpwawa,&lt;BR /&gt;
I am not sure that "roles" accepts comma separated lists of roles. Can you try submitting roles separately for this user in your request, as in&lt;BR /&gt;
-d roles="role1", -d roles="role2"&lt;/P&gt;

&lt;P&gt;Let me know if this doesn't work and I can do some more research into what's going on...&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 21:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297126#M7944</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2017-05-16T21:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why does creating a user with multiple roles fail when calling the REST API endpoint from curl?</title>
      <link>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297127#M7945</link>
      <description>&lt;P&gt;Yes, submitting the roles as separate items works - like this: -d roles="role1" -d roles="role2"&lt;/P&gt;

&lt;P&gt;Thanks a lot !!!&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 21:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297127#M7945</guid>
      <dc:creator>rpwawa</dc:creator>
      <dc:date>2017-05-16T21:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why does creating a user with multiple roles fail when calling the REST API endpoint from curl?</title>
      <link>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297128#M7946</link>
      <description>&lt;P&gt;awesome! I'll update the docs to mention this. Will convert my comment to an answer as it solved your question. Please feel free to accept it! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 00:37:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Why-does-creating-a-user-with-multiple-roles-fail-when-calling/m-p/297128#M7946</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2017-05-17T00:37:28Z</dc:date>
    </item>
  </channel>
</rss>

