I'm trying to update the ArcGIS Server Security source of users and roles using the arcgis/admin/security/config/updateIdentityStore web service over Python, but I'm getting the error message "Failed to update the identity store configuration. One or more server machines could not be updated with new user or role store configurations". Going into the GUI, it appears like things get saved correctly, but I can't get into the roles using the credentials.
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">updateIdentityStore</SPAN><SPAN class="punctuation token">(</SPAN>token<SPAN class="punctuation token">,</SPAN> serverName<SPAN class="punctuation token">,</SPAN> serverPort<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
securityProperties <SPAN class="operator token">=</SPAN> dict<SPAN class="punctuation token">(</SPAN>adminUserPassword <SPAN class="operator token">=</SPAN> 'MY<SPAN class="comment token">#DOMAIN#PASSWORD', adminUser = u'MYDOMAIN\MYDOMAINUSERNAME', domainControllerAddress = "MYDCIPADDRESS")</SPAN>
securitySettings <SPAN class="operator token">=</SPAN> dict<SPAN class="punctuation token">(</SPAN>type <SPAN class="operator token">=</SPAN> <SPAN class="string token">"WINDOWS"</SPAN><SPAN class="punctuation token">,</SPAN> properties <SPAN class="operator token">=</SPAN> securityProperties<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Serialize directory information to JSON </SPAN>
securitySettingsJSON <SPAN class="operator token">=</SPAN> json<SPAN class="punctuation token">.</SPAN>dumps<SPAN class="punctuation token">(</SPAN>securitySettings<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Construct URL to create a new site</SPAN>
createNewSiteURL <SPAN class="operator token">=</SPAN> <SPAN class="string token">"/arcgis/admin/security/config/updateIdentityStore"</SPAN>
<SPAN class="comment token"># Set up parameters for the request</SPAN>
params <SPAN class="operator token">=</SPAN> urllib<SPAN class="punctuation token">.</SPAN>urlencode<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'token'</SPAN><SPAN class="punctuation token">:</SPAN> token<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'userStoreConfig'</SPAN><SPAN class="punctuation token">:</SPAN>securitySettingsJSON<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'roleStoreConfig'</SPAN><SPAN class="punctuation token">:</SPAN>securitySettingsJSON<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'f'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'json'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
headers <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="string token">"Content-type"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"application/x-www-form-urlencoded"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Accept"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"text/plain"</SPAN><SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token"># Connect to URL and post parameters </SPAN>
httpConn <SPAN class="operator token">=</SPAN> httplib<SPAN class="punctuation token">.</SPAN>HTTPConnection<SPAN class="punctuation token">(</SPAN>serverName<SPAN class="punctuation token">,</SPAN> serverPort<SPAN class="punctuation token">)</SPAN>
httpConn<SPAN class="punctuation token">.</SPAN>request<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"POST"</SPAN><SPAN class="punctuation token">,</SPAN> createNewSiteURL<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">,</SPAN> headers<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Read response</SPAN>
response <SPAN class="operator token">=</SPAN> httpConn<SPAN class="punctuation token">.</SPAN>getresponse<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>response<SPAN class="punctuation token">.</SPAN>status <SPAN class="operator token">!=</SPAN> <SPAN class="number token">200</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
httpConn<SPAN class="punctuation token">.</SPAN>close<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Error while creating the site."</SPAN>
<SPAN class="keyword token">return</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
data <SPAN class="operator token">=</SPAN> response<SPAN class="punctuation token">.</SPAN>read<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
httpConn<SPAN class="punctuation token">.</SPAN>close<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Check that data returned is not an error object</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="operator token">not</SPAN> assertJsonSuccess<SPAN class="punctuation token">(</SPAN>data<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Error returned by operation. "</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>data<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Security updated successfully"</SPAN>
<SPAN class="keyword token">return</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>