TransWikia.com

Using ArcGIS API for Python and Windows Authentication?

Geographic Information Systems Asked by John Johnson on December 12, 2020

I’ve been trying to follow the ESRI recommended workflow to log on to Enterprise (using authentication), but it just doesn’t want to work. I’m able to get the account credentials registered in Windows Credential Manager, but if I try to run the program and access them via the API for Python, I keep receiving this error:

AttributeError                            Traceback (most recent call last)

<ipython-input-1-9fd4325b765b> in <module>

     11

     12

---> 13 gis =GIS(portal_url,profile=portal_profile, verify_cert=portal_cert_check)

     14 print('Good')

 

~AppDataLocalESRIcondaenvsarcgispro-py3-clone1libsite-packagesarcgisgis__init__.py in __init__(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)

    337                                    "argument when connecting to the GIS.")

    338             else:

--> 339                 raise e

    340         try:

    341             if url.lower().find("arcgis.com") > -1 and 

 

~AppDataLocalESRIcondaenvsarcgispro-py3-clone1libsite-packagesarcgisgis__init__.py in __init__(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)

    321                                            expiration=self._expiration,

    322                                            referer=self._referer,

--> 323                                            custom_auth=custom_auth)

    324             if self._is_hosted_nb_home:

    325                 # For GIS("home") objects, force no referer passed in

 

~AppDataLocalESRIcondaenvsarcgispro-py3-clone1libsite-packagesarcgisgis_impl_portalpy.py in __init__(self, url, username, password, key_file, cert_file, expiration, referer, proxy_host, proxy_port, connection, workdir, tokenurl, verify_cert, client_id, custom_auth, token)

    165                                       client_id=client_id,

    166                                       custom_auth=custom_auth,

--> 167                                       token=token)

    168         #self.get_version(True)

    169         self.get_properties(True)

 

~AppDataLocalESRIcondaenvsarcgispro-py3-clone1libsite-packagesarcgisgis_impl_con_connection.py in __init__(self, baseurl, username, password, **kwargs)

    156             self._auth = "PKI"

    157

--> 158         self._create_session()

    159

    160         #  Product Info

 

~AppDataLocalESRIcondaenvsarcgispro-py3-clone1libsite-packagesarcgisgis_impl_con_connection.py in _create_session(self)

    260             self._session.auth = GuessAuth(username=self._username,

    261                                            password=self._password)

--> 262         elif self._auth.lower() == "pro":

    263             self._session.auth = GuessAuth(None, None)

    264         else:

 

AttributeError: 'NoneType' object has no attribute 'lower'

One Answer

Maybe check the details in this bug

https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEwODA2Mw==

This bug is affecting me. and there doesn't seem to be a work around. its possibly related to the Python version, thats my next step is to downgrade.

FYI im using ArcGIS API 1.4.1 and Python 3.8

Answered by nr_aus on December 12, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP