<?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: Cannot establish credentialed connection using `GIS(url, username, password)` in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355989#M69517</link>
    <description>&lt;P&gt;Thanks so much for your help. Good to know I can just use GIS("home") from within AGOL.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 21:14:34 GMT</pubDate>
    <dc:creator>CameronAndrew</dc:creator>
    <dc:date>2023-12-01T21:14:34Z</dc:date>
    <item>
      <title>Cannot establish credentialed connection using `GIS(url, username, password)`</title>
      <link>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355904#M69513</link>
      <description>&lt;P&gt;Hello! I am trying to connect to my organization's AGOL as a first step in creating a script. But I cannot get paste stage one.&lt;BR /&gt;&lt;BR /&gt;I am using the Python within ArcGIS Pro (via the Python Window).&lt;/P&gt;&lt;P&gt;Running the following lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.features import FeatureLayer

gis = GIS(url = 'https://nngov.maps.arcgis.com', username='nne\\username', password='my_password')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am met with this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
In  [10]:
Line 2:     gis = GIS(url = 'https://nngov.maps.arcgis.com', username='nne\\cameronam', password='my_password')

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 585:   raise e

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 524:   self._portal = _portalpy.Portal(

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_portalpy.py, in __init__:
Line 205:   self.con = Connection(

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in __init__:
Line 344:   self._create_session()

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _create_session:
Line 691:   self._session.auth = EsriWindowsAuth(

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\auth\_auth\_winauth.py, in __init__:
Line 84:    raise Exception("Please ensure gssapi is installed")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;`gssapi` IS already installed, as confirmed when I went to the Python command prompt and tried to install it:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3&amp;gt;pip install gssapi&lt;BR /&gt;Defaulting to user installation because normal site-packages is not writeable&lt;BR /&gt;&lt;STRONG&gt;Requirement already satisfied: gssapi in c:\program files\arcgis\pro\bin\python\envs\arcgispro-py3\lib\site-packages (1.8.1)&lt;/STRONG&gt;&lt;BR /&gt;Requirement already satisfied: decorator in c:\program files\arcgis\pro\bin\python\envs\arcgispro-py3\lib\site-packages (from gssapi) (5.1.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My colleague succeeded in establishing the connection using her creds on her own machine, without being thrown an error related to 'gssapi'.&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#000000"&gt;gis = GIS("https://nngov.maps.arcgis.com", "nne\\her_username", "her_password") &amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone got any idea for a resolution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Andrew&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 19:43:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355904#M69513</guid>
      <dc:creator>CameronAndrew</dc:creator>
      <dc:date>2023-12-01T19:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot establish credentialed connection using `GIS(url, username, password)`</title>
      <link>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355910#M69514</link>
      <description>&lt;P&gt;There's a thread on this that might be of interest:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/please-ensure-gssapi-is-installed/td-p/1264853" target="_blank" rel="noopener"&gt;Please ensure gssapi is installed - Esri Community&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But an easy fix might be to just use&amp;nbsp;&lt;SPAN&gt;gis = GIS(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"pro"&lt;/SPAN&gt;&lt;SPAN&gt;) instead.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 19:48:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355910#M69514</guid>
      <dc:creator>JRhodes</dc:creator>
      <dc:date>2023-12-01T19:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot establish credentialed connection using `GIS(url, username, password)`</title>
      <link>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355914#M69515</link>
      <description>&lt;P&gt;Thanks, Joseph. Using gis = GIS("pro") withing Pro seems to have done the trick. But I assume its working correctly depends on my currently being logged into my Pro account. If I write this script in a Notebook, publish the Notebook to AGOL, and try to use it for the purpose of a scheduled task, the GIS connection would need to explicitly established with reference to the organization's AGOL url and someone's credentials. Does that sound right?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 19:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355914#M69515</guid>
      <dc:creator>CameronAndrew</dc:creator>
      <dc:date>2023-12-01T19:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot establish credentialed connection using `GIS(url, username, password)`</title>
      <link>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355926#M69516</link>
      <description>&lt;P&gt;In an AGOL notebook, you can just use gis=GIS("home"). In fact, that might be preferred over hardcoded credentials. This way, credentials aren't exposed, and if you change your password, you don't have to edit your Notebook code.&lt;/P&gt;&lt;P&gt;That said, I think the bug that is discussed in the link I sent is probably not relevant in an AGOL Notebook anyway. Seems to be limited to Pro 3.1/Python API 2.2.0.3. But I could be wrong about that.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 20:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355926#M69516</guid>
      <dc:creator>JRhodes</dc:creator>
      <dc:date>2023-12-01T20:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot establish credentialed connection using `GIS(url, username, password)`</title>
      <link>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355989#M69517</link>
      <description>&lt;P&gt;Thanks so much for your help. Good to know I can just use GIS("home") from within AGOL.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 21:14:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-establish-credentialed-connection-using-gis/m-p/1355989#M69517</guid>
      <dc:creator>CameronAndrew</dc:creator>
      <dc:date>2023-12-01T21:14:34Z</dc:date>
    </item>
  </channel>
</rss>

