<?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: AGOL/Portal login in Python 3.8 in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796514#M1821</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;is the token you are using current / not expired?&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;If logging in to ArcGIS Enterprise, check that there are no ssl certificate errors (this should not be the case with AGOL) if there is, see if adding verify_cert=False fixes the problem. if this fixes the problem with AGOL logins this could be an issue with python SSL handling.&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;gis = GIS("https://www.arcgis.com, "arcgis_python", "P@ssword123", verify_cert=False)&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;alternatively you may need to generate a new token. (response.text in the example below will contain the token). note that in this example you will need to register a client id for your application&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #aa0d91; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;import&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; requests url = &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"https://www.arcgis.com/sharing/rest/oauth2/token"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;payload = &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"client_id=CLIENT_ID_FROM_YOUR_APPLICATION&amp;amp;client_secret=CLIENT_SECRET_FROM_YOUR_APPLICATION&amp;amp;grant_type=client_credentials"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;headers = { &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'content-type'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"application/x-www-form-urlencoded"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'accept'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"application/json"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'cache-control'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"no-cache"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'postman-token'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"11df29d1-17d3-c58c-565f-2ca4092ddf5f"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; } &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;response = requests.request(&lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"POST"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, url, data=payload, headers=headers) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;print(response.text)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Oct 2020 03:29:37 GMT</pubDate>
    <dc:creator>MatthewBrown7</dc:creator>
    <dc:date>2020-10-26T03:29:37Z</dc:date>
    <item>
      <title>AGOL/Portal login in Python 3.8</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796513#M1820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I cannot login to AGOL/Portal since moving to Python 3.8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sample code is:&lt;/P&gt;&lt;PRE style="color: #4c4c4c; background-color: #f7f7f7; border: none; font-size: 16px;"&gt;&lt;SPAN class="" style="color: #008000; font-weight: bold;"&gt;from&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0000ff; font-weight: bold;"&gt;IPython.display&lt;/SPAN&gt; &lt;SPAN class="" style="color: #008000; font-weight: bold;"&gt;import&lt;/SPAN&gt; &lt;SPAN class=""&gt;display&lt;/SPAN&gt;&lt;SPAN class="" style="color: #008000; font-weight: bold;"&gt;from&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0000ff; font-weight: bold;"&gt;arcgis.gis&lt;/SPAN&gt; &lt;SPAN class="" style="color: #008000; font-weight: bold;"&gt;import&lt;/SPAN&gt; &lt;SPAN class=""&gt;GIS&lt;/SPAN&gt;&lt;SPAN class="" style="color: #008000; font-weight: bold;"&gt;import&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0000ff; font-weight: bold;"&gt;os&lt;/SPAN&gt;&lt;SPAN class=""&gt;username&lt;/SPAN&gt; &lt;SPAN class="" style="color: #666666;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ba2121;"&gt;"arcgis_python"&lt;/SPAN&gt;&lt;SPAN class=""&gt;password&lt;/SPAN&gt; &lt;SPAN class="" style="color: #666666;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #ba2121;"&gt;"P@ssword123"&lt;/SPAN&gt;&lt;SPAN class=""&gt;gis&lt;/SPAN&gt; &lt;SPAN class="" style="color: #666666;"&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;GIS&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ba2121;"&gt;"https://www.arcgis.com"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;username&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;password&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have replaced with my values, and have a token.&lt;/P&gt;&lt;P&gt;But keep getting a tokenURL or the token is not valid error??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from arcgis.features import FeatureLayer, GeoAccessor, GeoSeriesAccessor&lt;BR /&gt;from arcgis.geoenrichment import enrich&lt;BR /&gt;from arcgis import dissolve_boundaries&lt;BR /&gt;from arcgis.geometry import project&lt;BR /&gt;from arcgis.gis import GIS&lt;/P&gt;&lt;P&gt;# Organization Login&lt;BR /&gt;## gis = GIS('http://www.arcgis.com', 'username', 'password')&lt;/P&gt;&lt;P&gt;portal_url =&amp;nbsp;url&lt;BR /&gt;token=mytoken&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;gis = portal_url+token&lt;/P&gt;&lt;P&gt;print("Logged IN to portal URL")&lt;/P&gt;&lt;P&gt;cfa_url=url+token&lt;/P&gt;&lt;P&gt;cfa_fl = FeatureLayer(cfa_url+token)&lt;BR /&gt;dc_df = GeoAccessor.from_layer(cfa_fl)&lt;BR /&gt;display(dc_df.head())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to automatically login to AGOL/Portal to home or contents, to browse the MapServices, FeatureServices, etc..&lt;/P&gt;&lt;P&gt;Any assistance is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Oct 2020 21:56:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796513#M1820</guid>
      <dc:creator>EK_GISAdmin</dc:creator>
      <dc:date>2020-10-25T21:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL/Portal login in Python 3.8</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796514#M1821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;is the token you are using current / not expired?&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;If logging in to ArcGIS Enterprise, check that there are no ssl certificate errors (this should not be the case with AGOL) if there is, see if adding verify_cert=False fixes the problem. if this fixes the problem with AGOL logins this could be an issue with python SSL handling.&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;gis = GIS("https://www.arcgis.com, "arcgis_python", "P@ssword123", verify_cert=False)&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;alternatively you may need to generate a new token. (response.text in the example below will contain the token). note that in this example you will need to register a client id for your application&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #aa0d91; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;import&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; requests url = &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"https://www.arcgis.com/sharing/rest/oauth2/token"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;payload = &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"client_id=CLIENT_ID_FROM_YOUR_APPLICATION&amp;amp;client_secret=CLIENT_SECRET_FROM_YOUR_APPLICATION&amp;amp;grant_type=client_credentials"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;headers = { &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'content-type'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"application/x-www-form-urlencoded"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'accept'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"application/json"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'cache-control'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"no-cache"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;'postman-token'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"11df29d1-17d3-c58c-565f-2ca4092ddf5f"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; } &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;response = requests.request(&lt;/SPAN&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; ,&amp;amp;quot: ; color: #c41a16; white-space: pre; font-weight: 400; letter-spacing: normal; text-decoration: none; lucida console&amp;amp;quot: ; consolas&amp;amp;quot: ; font-size: 13.93px; font-style: normal; ,monospace: ; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; andale mono&amp;amp;quot: ; font-family: &amp;amp;quot; orphans: 2; monaco&amp;amp;quot: ; text-align: left; "&gt;"POST"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;, url, data=payload, headers=headers) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.87em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;print(response.text)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2020 03:29:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796514#M1821</guid>
      <dc:creator>MatthewBrown7</dc:creator>
      <dc:date>2020-10-26T03:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL/Portal login in Python 3.8</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796515#M1822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please share the exact error message you get when logging in?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2020 20:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796515#M1822</guid>
      <dc:creator>GeoJosh</dc:creator>
      <dc:date>2020-10-26T20:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL/Portal login in Python 3.8</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796516#M1823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I updated the ESRI sample (&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/portal/10.7/administer/windows/scripting-with-the-arcgis-rest-api.htm" title="https://enterprise.arcgis.com/en/portal/10.7/administer/windows/scripting-with-the-arcgis-rest-api.htm"&gt;Scripting with the ArcGIS REST API—Portal for ArcGIS | Documentation for ArcGIS Enterprise&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can log into our Portal, but not our AGOL??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the following error now, when trying to login to our AGOL??&lt;/P&gt;&lt;P&gt;Error:&amp;nbsp;&lt;SPAN style="font-weight: 500;"&gt;This site can’t be reached&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 500;"&gt;server IP address could not be found&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 16:47:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796516#M1823</guid>
      <dc:creator>CliveSwan</dc:creator>
      <dc:date>2020-10-29T16:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL/Portal login in Python 3.8</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796517#M1824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can login to our &lt;STRONG&gt;company AGOL&lt;/STRONG&gt; now using..&lt;/P&gt;&lt;P&gt;agolUrl = GIS(portal_link, username = agolusername, password = agolpassword)&lt;BR /&gt;## print("Logged in as: " + str(insPortal.properties))&lt;BR /&gt;print('Login Succesful')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am now getting an error logging into &lt;STRONG&gt;company Portal&lt;/STRONG&gt;, it was working before??&lt;/P&gt;&lt;P&gt;Don't understand why I am getting an error, when it was working before??&lt;/P&gt;&lt;P&gt;ESRI documentation says that it only reads approx 16 characters, but the token generated is 192 chars long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;portalUrl = GIS(portal_link+token, username = agolusername, password = agolpassword, verify_cert=False)&lt;BR /&gt;##print("Logged IN")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\arcgis\gis\_imppy", line 1143, in _enterprise_token&lt;BR /&gt; res = self.post(path=self._token_url,&lt;BR /&gt; File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\arcgis\gis\_imppy", line 700, in post&lt;BR /&gt; raise Exception('A general error occurred: %s' % e)&lt;BR /&gt;Exception: A general error occurred: encoding with 'idna' codec failed (UnicodeError: label too lon&lt;BR /&gt;PS C:\Users\user\OneDrive - EKFB\Documents\Apps&amp;gt; &amp;amp; C:/Users/user/AppData/Local/Programs/Pon.exe "c:/Users/user/OneDrive - EKFB/Documents/Apps/Python Scripts/Portal.py"&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\encodings\idna.py", line 167,&lt;BR /&gt; raise UnicodeError("label too long")&lt;BR /&gt;UnicodeError: label too long&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2020 09:20:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796517#M1824</guid>
      <dc:creator>EK_GISAdmin</dc:creator>
      <dc:date>2020-10-30T09:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL/Portal login in Python 3.8</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796518#M1825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also getting the same error using Jupyter Notebooks: label to long??&lt;/P&gt;&lt;P&gt;This is an ESRI token!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jupyter Notebooks error:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px; padding: 1px 0px;"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;UnicodeError&lt;/SPAN&gt;                              Traceback (most recent call last)&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\encodings\idna.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;encode&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, input, errors)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    166&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;labels&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="" style="color: #258f8f; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #258f8f; font-weight: bold;"&gt;64&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 167&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                 &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;raise&lt;/SPAN&gt; UnicodeError&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"label too long"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    168&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;return&lt;/SPAN&gt; result&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; len&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;input&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;UnicodeError&lt;/SPAN&gt;: label too long  The above exception was the direct cause of the following exception: &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;UnicodeError&lt;/SPAN&gt;                              Traceback (most recent call last)&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;post&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, path, params, files, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    673&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;else&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 674&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                 resp = self._session.post(url=url,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    675&lt;/SPAN&gt;                                           data&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;params&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\requests\sessions.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;post&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, url, data, json, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    577&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 578&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;         &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;return&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;request&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'POST'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; url&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; data&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;data&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; json&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;json&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;**&lt;/SPAN&gt;kwargs&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    579&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\requests\sessions.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;request&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    529&lt;/SPAN&gt;         send_kwargs&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;settings&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 530&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;         &lt;/SPAN&gt;resp &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;send&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;prep&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;**&lt;/SPAN&gt;send_kwargs&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    531&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\requests\sessions.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;send&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, request, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    642&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# Send the request&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 643&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;         &lt;/SPAN&gt;r &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; adapter&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;send&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;request&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;**&lt;/SPAN&gt;kwargs&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    644&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\requests\adapters.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;send&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, request, stream, timeout, verify, cert, proxies)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    438&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; chunked&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 439&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                 resp = conn.urlopen(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    440&lt;/SPAN&gt;                     method&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;request&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;method&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\urllib3\connectionpool.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;urlopen&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    669&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# Make the request on the httplib connection object.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 670&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;             httplib_response = self._make_request(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    671&lt;/SPAN&gt;                 conn&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\urllib3\connectionpool.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;_make_request&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, conn, method, url, timeout, chunked, **httplib_request_kw)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    380&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;try&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 381&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;             &lt;/SPAN&gt;self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_validate_conn&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;conn&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    382&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;except&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;SocketTimeout&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; BaseSSLError&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\urllib3\connectionpool.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;_validate_conn&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, conn)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    975&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; getattr&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;conn&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"sock"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# AppEngine might not have  `.sock`&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 976&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;             &lt;/SPAN&gt;conn&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;connect&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    977&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\urllib3\connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;connect&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    307&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# Add certificate verification&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 308&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;         &lt;/SPAN&gt;conn &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_new_conn&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    309&lt;/SPAN&gt;         hostname &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;host &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\urllib3\connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;_new_conn&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    158&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;try&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 159&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;             conn = connection.create_connection(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    160&lt;/SPAN&gt;                 &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_dns_host&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;port&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;timeout&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;**&lt;/SPAN&gt;extra_kw &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\urllib3\util\connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;create_connection&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(address, timeout, source_address, socket_options)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     60&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;---&amp;gt; 61&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;     &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;for&lt;/SPAN&gt; res &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;in&lt;/SPAN&gt; socket&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;getaddrinfo&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;host&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; port&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; family&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; socket&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;SOCK_STREAM&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     62&lt;/SPAN&gt;         af&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; socktype&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; proto&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; canonname&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; sa &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; res &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\socket.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;getaddrinfo&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(host, port, family, type, proto, flags)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    917&lt;/SPAN&gt;     addrlist &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 918&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;     &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;for&lt;/SPAN&gt; res &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;in&lt;/SPAN&gt; _socket&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;getaddrinfo&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;host&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; port&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; family&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; type&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; proto&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; flags&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    919&lt;/SPAN&gt;         af&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; socktype&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; proto&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; canonname&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; sa &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; res &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;UnicodeError&lt;/SPAN&gt;: encoding with 'idna' codec failed (UnicodeError: label too long)  During handling of the above exception, another exception occurred: &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;Exception&lt;/SPAN&gt;                                 Traceback (most recent call last)&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;&amp;lt;ipython-input-2-0051d4567ffa&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     21&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;     22&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;---&amp;gt; 23&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt; &lt;/SPAN&gt;portal &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;portalURL&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt;token&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; username&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; password&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; verify_cert&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;False&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     24&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;     25&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;#### Get Users and Items&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;__init__&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    337&lt;/SPAN&gt;                                    "argument when connecting to the GIS.")&lt;SPAN class="" style="color: #00a250;"&gt;    338&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;else&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 339&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                 &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;raise&lt;/SPAN&gt; e&lt;SPAN class="" style="color: #00a250;"&gt;    340&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;try&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    341&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; url&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;lower&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;find&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="" style="color: #258f8f; font-weight: bold;"&gt;1&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;and&lt;/SPAN&gt;&lt;SPAN class="" style="color: #e75c58;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #e75c58;"&gt;\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;__init__&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    312&lt;/SPAN&gt;             self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_expiration &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #258f8f; font-weight: bold;"&gt;60&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    313&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;try&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 314&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;             self._portal = _portalpy.Portal(self._url, self._username,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    315&lt;/SPAN&gt;                                            self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_password&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_key_file&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    316&lt;/SPAN&gt;                                            self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_cert_file&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_portalpy.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;__init__&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, url, username, password, key_file, cert_file, expiration, referer, proxy_host, proxy_port, connection, workdir, tokenurl, verify_cert, client_id, custom_auth, token)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    167&lt;/SPAN&gt;                                       token=token)&lt;SPAN class="" style="color: #00a250;"&gt;    168&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;#self.get_version(True)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 169&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;         &lt;/SPAN&gt;self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;get_properties&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    170&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;    171&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_portalpy.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;get_properties&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, force)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1107&lt;/SPAN&gt;                     resp &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;con&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; ssl&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# issue seen with key, cert auth&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1108&lt;/SPAN&gt;                 &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; resp&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1109&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                     &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;raise&lt;/SPAN&gt; e&lt;SPAN class="" style="color: #00a250;"&gt;   1110&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;   1111&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; resp&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_portalpy.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;get_properties&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, force)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1095&lt;/SPAN&gt;             resp &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1096&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;try&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1097&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                 &lt;/SPAN&gt;resp &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;con&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;post&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_postdata&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; ssl&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1098&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;except&lt;/SPAN&gt; Exception &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1099&lt;/SPAN&gt;                 &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;con&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_verify_cert &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;and&lt;/SPAN&gt;&lt;SPAN class="" style="color: #e75c58;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #e75c58;"&gt;\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;post&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, path, params, files, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    619&lt;/SPAN&gt;                     params&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;pop&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'token'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    620&lt;/SPAN&gt;                     &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;#pass&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 621&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;             &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;elif&lt;/SPAN&gt; token_as_header &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;==&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;False&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;and&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;token &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;is&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;#as ?token=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    622&lt;/SPAN&gt;                 params&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'token'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;token&lt;SPAN class="" style="color: #00a250;"&gt;    623&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;elif&lt;/SPAN&gt; token_as_header &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;and&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;token &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;is&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;#(token and token != _DEFAULT_TOKEN): # as X-Esri-Auth header with given token&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;token&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1026&lt;/SPAN&gt;                                    "AGO", "ENTERPRISE"] and \&lt;SPAN class="" style="color: #00a250;"&gt;   1027&lt;/SPAN&gt;                  self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_auth &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;==&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"BUILTIN"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1028&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                 &lt;/SPAN&gt;self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_token &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_enterprise_token&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1029&lt;/SPAN&gt;                 &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;return&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_token&lt;SPAN class="" style="color: #00a250;"&gt;   1030&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;else&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;_enterprise_token&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1141&lt;/SPAN&gt;                                                                                 path.split('/')[0])&lt;SPAN class="" style="color: #00a250;"&gt;   1142&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1143&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;         res = self.post(path=self._token_url,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1144&lt;/SPAN&gt;                         params&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;postdata&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   1145&lt;/SPAN&gt;                         add_token=False) &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;~\anaconda3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;post&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, path, params, files, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    698&lt;/SPAN&gt;                 "URL scheme must be provided: %s" % errMS)&lt;SPAN class="" style="color: #00a250;"&gt;    699&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;except&lt;/SPAN&gt; Exception &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 700&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;             &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;raise&lt;/SPAN&gt; Exception&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'A general error occurred: %s'&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;%&lt;/SPAN&gt; e&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    701&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;except&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    702&lt;/SPAN&gt;             &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;import&lt;/SPAN&gt; traceback &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;Exception&lt;/SPAN&gt;: A general error occurred: encoding with 'idna' codec failed (UnicodeError: label too long)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2020 09:30:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-portal-login-in-python-3-8/m-p/796518#M1825</guid>
      <dc:creator>EK_GISAdmin</dc:creator>
      <dc:date>2020-10-30T09:30:12Z</dc:date>
    </item>
  </channel>
</rss>

