<?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: Get the token using ArcGIS Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876348#M4920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am migrating some code built roughly 3 years ago using ArcREST. In one piece of the code, I need to download the data in the feature service(create Replica) and save the data in a local database.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you know, the replica will be stored in AGO organization as the following:&lt;/P&gt;&lt;P&gt;&lt;A class="unlinked"&gt;http://services1.arcgis.com/pdfadfdafkkllADFAA/ArcGIS/rest/services/RIASP22015/FeatureServer/replicafiles/4e70a029d5b742508d33ca2efb87ca29.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To download the zip file and unzip it, I need a token to access AGO organization.&amp;nbsp;This was required in my old code, and I am doing a like for like migration at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explains it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Simo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2018 22:46:17 GMT</pubDate>
    <dc:creator>simoxu</dc:creator>
    <dc:date>2018-03-15T22:46:17Z</dc:date>
    <item>
      <title>Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876344#M4916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a clue how to access token using ArcGIS Python API?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe a token was generated when instantiating the GIS class&amp;nbsp;as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from &lt;/EM&gt;arcgis&lt;EM&gt;.gis import GIS&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;gis=GIS(url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;...",username="",password="")&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought the token should be stored somewhere in the gis object, I looked up and down the list of properties and methods but nowhere can I find it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advices&amp;nbsp;and suggestions are highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 05:59:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876344#M4916</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-03-14T05:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876345#M4917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can find this with the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcgis
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS
gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"jskinner_CountySandbox"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"*****"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
token &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_con&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;token
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;token&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:59:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876345#M4917</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T10:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876346#M4918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works!&amp;nbsp;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 01:06:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876346#M4918</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-03-15T01:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876347#M4919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you mind sharing why you need access to the token though? Is there something in the API or your workflow that needs access to this token?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 01:09:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876347#M4919</guid>
      <dc:creator>RohitSingh2</dc:creator>
      <dc:date>2018-03-15T01:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876348#M4920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am migrating some code built roughly 3 years ago using ArcREST. In one piece of the code, I need to download the data in the feature service(create Replica) and save the data in a local database.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you know, the replica will be stored in AGO organization as the following:&lt;/P&gt;&lt;P&gt;&lt;A class="unlinked"&gt;http://services1.arcgis.com/pdfadfdafkkllADFAA/ArcGIS/rest/services/RIASP22015/FeatureServer/replicafiles/4e70a029d5b742508d33ca2efb87ca29.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To download the zip file and unzip it, I need a token to access AGO organization.&amp;nbsp;This was required in my old code, and I am doing a like for like migration at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explains it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Simo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 22:46:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876348#M4920</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-03-15T22:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876349#M4921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just an FYI, you can use the following tool to download your data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-6496-download-arcgis-online-feature-service-or-arcgis-server-featuremap-service"&gt;https://community.esri.com/docs/DOC-6496-download-arcgis-online-feature-service-or-arcgis-server-featuremap-service&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 11:51:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876349#M4921</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-03-16T11:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876350#M4922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jake.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Mar 2018 22:22:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/876350#M4922</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-03-18T22:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1109029#M6747</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/254682"&gt;@RohitSingh2&lt;/a&gt;&amp;nbsp;are there any plans to add the ability to access &amp;amp; download replicas directly through the Python API? I am running into this same issue as &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12731"&gt;@simoxu&lt;/a&gt;&amp;nbsp;. The Python API can get us so close, but then to need to use requests to get the path to the output is a bit disappointing. The API has spoiled us by making most of these actions so easy!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 22:17:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1109029#M6747</guid>
      <dc:creator>AllisonMuise2</dc:creator>
      <dc:date>2021-10-19T22:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1354770#M9339</link>
      <description>&lt;P&gt;I know this is an old post, but I'm wondering if there is a newer convention for accessing the authentication token? I've been using:&lt;/P&gt;&lt;P&gt;gis = GIS("home")&lt;BR /&gt;print("Token: " + str(gis._con.token))&lt;/P&gt;&lt;P&gt;which worked up until our org updated to 3.2 from 2.9, but doesn't work anymore - gis._con.token now returns 'None', whereas previously would return the token string.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 18:39:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1354770#M9339</guid>
      <dc:creator>DCWORK_GIS</dc:creator>
      <dc:date>2023-11-29T18:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1360439#M9411</link>
      <description>&lt;P&gt;Try this, you will have to import the arcpy module,&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;token = (arcpy.GetSigninToken())[&lt;/SPAN&gt;&lt;SPAN&gt;'token'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Dec 2023 17:30:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1360439#M9411</guid>
      <dc:creator>sredar</dc:creator>
      <dc:date>2023-12-13T17:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1362388#M9432</link>
      <description>&lt;P&gt;That does work, but in my case, my goal is to use this script, and others like it in AGOL Notebooks, and my org doesn't pay for ArcPy there. So I'm limited to only using the API for Python.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 05:04:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1362388#M9432</guid>
      <dc:creator>DCWORK_GIS</dc:creator>
      <dc:date>2023-12-19T05:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1363832#M9452</link>
      <description>&lt;P&gt;What the heck, now I am getting the same thing you are with&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;token = gis._con.token&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Its returns None and just yesterday it worked&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In a Notebook it does works but it no longer&amp;nbsp; my in local IDE.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Dec 2023 23:36:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1363832#M9452</guid>
      <dc:creator>sredar</dc:creator>
      <dc:date>2023-12-21T23:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1363852#M9453</link>
      <description>&lt;P&gt;But yesterday it did? That's really weird. I noticed it after we upgraded from 2.7 to 3.2, but maybe it's something else. ESRI's been non-responsive about the issue. Maybe it's a bug.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 02:21:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1363852#M9453</guid>
      <dc:creator>DCWORK_GIS</dc:creator>
      <dc:date>2023-12-22T02:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1364327#M9455</link>
      <description>&lt;P&gt;&lt;STRONG&gt;The issue appears to be related to how you access the 'gis', this works:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;gis = arcgis.GIS(url='https://{org}.maps.arcgis.com/', username=user, password=pswrd)&lt;/P&gt;&lt;P&gt;token = gis._con.token&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;this does not:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;gis = arcgis.GIS("pro")&lt;/P&gt;&lt;P&gt;token = gis._con.token&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 17:49:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1364327#M9455</guid>
      <dc:creator>sredar</dc:creator>
      <dc:date>2023-12-26T17:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1365856#M9470</link>
      <description>&lt;P&gt;This is bad... Now, even though the user is logged into the Portal in Pro, you must pass those same credentials hardcoded in your Python script.&lt;BR /&gt;Thanks,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/606236"&gt;@sredar&lt;/a&gt;&amp;nbsp;for discovering this.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 16:30:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1365856#M9470</guid>
      <dc:creator>vpelleritoCritigen</dc:creator>
      <dc:date>2024-01-03T16:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1398783#M9793</link>
      <description>&lt;P&gt;Same issue here.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/606236"&gt;@sredar&lt;/a&gt;'s workaround is great for my current project (thanks), but there are lots of other cases where arcpy isn't available and I need to get an access token from the GIS object.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 23:07:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1398783#M9793</guid>
      <dc:creator>JRhodes</dc:creator>
      <dc:date>2024-03-20T23:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get the token using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1457976#M10009</link>
      <description>&lt;P&gt;This is another option for getting the token without needing to store the credentials in the script, but it does require some initial setup on the computer that you plan to run the process on because you need to create a profile that will be used for all your future scripts.1st Run:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;gis = GIS("&lt;A href="https://www.arcgis.com/" target="_blank" rel="noopener"&gt;https://www.arcgis.com/", "USERNAME", "PASSWORD", profile="profile_name")&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Future Runs:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;gis &lt;SPAN&gt;= &lt;SPAN&gt;GIS&lt;SPAN&gt;(&lt;SPAN&gt;profile&lt;SPAN&gt;=&lt;SPAN&gt;"profile_name"&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;With this, you should be able to access the token using gis._con.token&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Note: The credentials should be stored at&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Control Panel\User Accounts\Manage your Credentials\Windows Credentials&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Update: The GIS module now supports getting the token&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="python"&gt;gis.session.auth.token&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Oct 2025 12:07:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/m-p/1457976#M10009</guid>
      <dc:creator>Matthew_Muehlhauser</dc:creator>
      <dc:date>2025-10-07T12:07:36Z</dc:date>
    </item>
  </channel>
</rss>

