I have done lots of searching about this but have not found anything in Esri documentation or here in the Community, so I thought I'd see if anyone can help.
My organization is in the midst of a server migration. In our old ArcGIS Server environment, we had token authentication, but in the new one, we have web-tier authentication. I am trying to migrate a Python script that rebuilt an address locator in the old environment; the script includes stopping and then starting services, which is necessary for rebuilding the address locator. I have 2 main problems:
Thanks so much!
You can use the requests_ntlm library using the HttpNtlmAuth or HttpNegotiateAuth functions. HttpNtlmAuth requires you to pass in a username and password but HttpNegotiateAuth can simulate a single sign on experience.
For services that are not on a federated Server using IWA, once you know what APIs are responsible for stopping/starting services, you can use the requests library; the samples on their help page are pretty useful. For example, use either function above, then use the auth object in the requests.post function:
response = requests.post(url,data=params,auth=auth).text
Thank you, Jonathan! I appreciate your reply.
I don't really know anything about requests and scripting internet-related things (someone else wrote the scripts that I have to work with), so I don't yet understand what those sources are talking about, but I will keep doing research and learning. You have given me a helpful starting place, with those links and your reply. Thank you!!