I am new to this API, I tried it with ArcGIS Online it works fine. But when I try to connect to our local ArcGIS portal, it doesn't work. Can anybody kindly point me to the right direction? I highly suspect that the problem is the API can't pick up my windows credentials which is required to login the portal.
Our portal is using IWA authentication, and this document for IWA points to not using a username or password:
I have come across a case when the portal was actually configured to use SAML.
To rule that out, can you try the following:
test_client_id = 'OGz1I2eoO8dO0ii2' #replace with your client id
gis = GIS('https://your portal url', client_id=test_client_id)
Thank you so much for your reply.
I tested as you suggested, but the problem remains. I double checked with the administrator, we are using IWA, not SAML.
I not only tested in Jupyter notebook, I also tried in python IDE (Wing IDE) to make direct connections to the portal, but it was not successful.
Surely there is something wrong on our server, just don't know where to look at. I checked it with this document, Use Integrated Windows Authentication with your portal—Portal for ArcGIS (10.5.x) | ArcGIS Enterpris... , nothing looks suspicious in the server settings.
Update: I just tried the python window in ArcGIS Pro, I can login our portal from there omitting the username and password ---- and I print out the user information, it seems the API picked up my windows login inside of ArcGIS Pro. Python window in Pro is not the ideal environment for me to do my tasks.
After I overwrote the arcgis related packages under anaconda3 using the packages under ArcGIS pro, everything seems working fine.
The packages installed by conda is slightly different from those installed by ArcGIS Pro...
don't know why, but It's working, I am happy
Update: the working version is version 1.0.1 on Python 3.5 .... I am missing out lots of latest features tho.
OK, it is a bug for 1.2.0, 1.2.1, 1.2.2, 1.2.3 and finally addressed in the latest release of 1.2.4! well, sort of...
The bug was only submitted on Sep 15 and I reported the issue as a comment on the 1.2.0 release announcement on Sep 11. coincident?
Hi simo xu,
I think I may be experiencing a similar issue. Can you provide some detail on what you meant when you said "I overwrote the arcgis related packages under anaconda3 using the packages under ArcGIS pro"? I don't currently have Anaconda3 installed. I have Anaconda 2, and toggle between environments with settings in my IDE. Any assistance would be appreciated.
Yeah, that's not my problem. I have multiple Python environments and successfully switch between them and have successfully used the Python API for other actions. I'm trying to connect to a secure ArcGIS Enterprise service and having no luck. I've successfully accessed secure hosted services before, but just updated Pro and wondering if something went awry. I was curious what the original poster meant by replacing arcgis related packages under Anaconda3 using the packages under ArcGIS Pro. I'm not seeing an Anaconda3 set of things under my Pro folder, and don't have A3 installed. I'm assuming the original poster did have A3 installed and worked to get the API dependencies setup with it also. Not sure...
I did the same thing as he did to get it to work with an Aneconda install. One thing you could do is just use the ArcGIS Pro install of python and add the packages for the python API (can event do with the Pro tools). What I did was copy the files in the /lib folder from a pro installation to the /lib folder in my Anecoda install. Not sure why but this fixed the issue with connecting using single sign on AD. I have had weird behavior with install, sometimes it has worked right off the bat, another I had to do as the original poster describes.