<?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: Generate Token - Python Code ArcGIS Enterprise HA in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-token-python-code-arcgis-enterprise-ha/m-p/1106726#M31265</link>
    <description>&lt;P&gt;Can you test locally with port 7443 for each Portal machine and the web adaptor (if present)? That would tell us whether the delay is indeed introduced by the ELB or if there is something else going on in the deployment.&lt;/P&gt;&lt;P&gt;Additionally it may be useful to enable access logging on the ELB for some insight into the web requests in transit.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 15:47:22 GMT</pubDate>
    <dc:creator>ChristopherPawlyszyn</dc:creator>
    <dc:date>2021-10-12T15:47:22Z</dc:date>
    <item>
      <title>Generate Token - Python Code ArcGIS Enterprise HA</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-token-python-code-arcgis-enterprise-ha/m-p/1105279#M31241</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Hi All,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I'm getting some strange behavior in my HA ArcGIS Enterprise on AWS. It taken to long (21 seconds) to generate a token through a python code, it's the code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;import time&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;import requests&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;import json&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;def generate_token():&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_time = time.time()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;payload = { 'username': 'usuario', 'password': 'SECRET', 'referer': '&lt;/SPAN&gt;&lt;A title="" href="https://SITE.com.br/portal/portaladmin" target="_blank" rel="noopener noreferrer"&gt;https://SITE.com.br/portal/portaladmin&lt;/A&gt;&lt;SPAN class=""&gt;', 'f': 'json' }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;r = requests.post('&lt;/SPAN&gt;&lt;A title="" href="https://SITE.com.br/portal/sharing/rest/generateToken" target="_blank" rel="noopener noreferrer"&gt;https://SITE.com.br/portal/sharing/rest/generateToken&lt;/A&gt;&lt;SPAN class=""&gt;', data=payload)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;response = json.loads(r.text)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;token = response['token']&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;print("--- %s segundos ---" % (time.time() - start_time))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return token&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;print(generate_token())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;When I run this code at my staging environment without ELB the code works very well and token is generated quickly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Does someone had faced this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Or any tip&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;My environment is 10.8.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Wellington&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-token-python-code-arcgis-enterprise-ha/m-p/1105279#M31241</guid>
      <dc:creator>WellingtonChristian_Rodrigues_</dc:creator>
      <dc:date>2021-10-06T18:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Token - Python Code ArcGIS Enterprise HA</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-token-python-code-arcgis-enterprise-ha/m-p/1106726#M31265</link>
      <description>&lt;P&gt;Can you test locally with port 7443 for each Portal machine and the web adaptor (if present)? That would tell us whether the delay is indeed introduced by the ELB or if there is something else going on in the deployment.&lt;/P&gt;&lt;P&gt;Additionally it may be useful to enable access logging on the ELB for some insight into the web requests in transit.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 15:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-token-python-code-arcgis-enterprise-ha/m-p/1106726#M31265</guid>
      <dc:creator>ChristopherPawlyszyn</dc:creator>
      <dc:date>2021-10-12T15:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Token - Python Code ArcGIS Enterprise HA</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-token-python-code-arcgis-enterprise-ha/m-p/1107212#M31276</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/196643"&gt;@ChristopherPawlyszyn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did it last friday hitting on 7443 and through the web adaptor, this way I could generate token quickly. Additionally I've even changed the ELB from Classic to Application ELB, nothing different till now. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 17:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-token-python-code-arcgis-enterprise-ha/m-p/1107212#M31276</guid>
      <dc:creator>WellingtonChristian_Rodrigues_</dc:creator>
      <dc:date>2021-10-13T17:47:33Z</dc:date>
    </item>
  </channel>
</rss>

