<?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: How to increase time before token expires with Arcgis Python API? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/1056418#M6037</link>
    <description>&lt;P&gt;I've got the same issue.. trying to run Portal site exports from the backend. The export takes around 65 minutes so I can't move on with the same token to export the Hosting site. Looks like you can't set the token timeout within the Python API -&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/1.6.2/arcgis.gis.toc.html#gis" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/1.6.2/arcgis.gis.toc.html#gis&lt;/A&gt;&amp;nbsp;On the generate token page it defaults to 1h and then options from there. But the Class doesn't have to extend the log in period. Would have been a nice to have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;10-05-2021 20:20:41 -- DEBUG: Staging Portal site at:- &lt;A href="https://server.domain:7443/arcgis/portaladmin" target="_blank"&gt;https://server.domain:7443/arcgis/portaladmin&lt;/A&gt; exported successfully.&lt;BR /&gt;Exported file: 10-May-2021-19-17-13-BST-FULL.portalsite&lt;/P&gt;&lt;P&gt;10-05-2021 20:20:41 -- DEBUG: REQUEST (get): &lt;A href="https://server.domain:7443/arcgis/portaladmin/federation/servers?f=json&amp;amp;token=maOGZlpLrHHj_UjxwmPGS_nOzf6WtWwodowK0HPOoYcVNtGskyKBRoLvEIW06VspdF9bWtQrt8myYSRNGs7roKkUhgw8Y3pRljjsIDU3rUrBhpN421SNmOIdb0FtU-uv" target="_blank"&gt;https://server.domain:7443/arcgis/portaladmin/federation/servers?f=json&amp;amp;token=maOGZlpLrHHj_UjxwmPGS_nOzf6WtWwodowK0HPOoYcVNtGskyKBRoLvEIW06VspdF9bWtQrt8myYSRNGs7roKkUhgw8Y3pRljjsIDU3rUrBhpN421SNmOIdb0FtU-uv&lt;/A&gt;&lt;BR /&gt;10-05-2021 20:20:42 -- INFO: Token expired during get request, fetching a new token and retrying&lt;BR /&gt;10-05-2021 20:20:42 -- DEBUG: REQUEST: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/&lt;/A&gt;, {'f': 'json'}&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: RESPONSE: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/&lt;/A&gt;, {"currentVersion":"6.1"}&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: REQUEST: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/generateToken" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/generateToken&lt;/A&gt;&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: RESPONSE: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/generateToken" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/generateToken&lt;/A&gt;, {"token":"Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98","expires":1620678043117,"ssl":true}&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: REQUEST (get): &lt;A href="https://server.domain:7443/arcgis/portaladmin/federation/servers?token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98?f=json&amp;amp;token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98" target="_blank"&gt;https://server.domain:7443/arcgis/portaladmin/federation/servers?token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98?f=json&amp;amp;token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 May 2021 20:18:59 GMT</pubDate>
    <dc:creator>PaulBatley</dc:creator>
    <dc:date>2021-05-10T20:18:59Z</dc:date>
    <item>
      <title>How to increase time before token expires with Arcgis Python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/882356#M5175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know you can increase the time before a token expires when using the Arcgis REST API in the parameters you pass, but can you do the same using the Arcgis Python API? I know how to access the token using 'gis._con.token' and the time beofre expiry with 'gis._con._expiration', but is there somewhere I can increase the time before expiration to higher than the default 60 minutes via the python API? Or should I simply re-authenticate my credentials using 'GIS(portal, username, password)' after 60 minutes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2020 20:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/882356#M5175</guid>
      <dc:creator>NathanielCregut</dc:creator>
      <dc:date>2020-06-17T20:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase time before token expires with Arcgis Python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/882357#M5176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would re-authenticate. Having a long expiry token can be considered a security risk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However saying that, you can also get the token from the rest end point and pass in that token in your GIS. Only for build in users though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/497391_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2020 05:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/882357#M5176</guid>
      <dc:creator>VictorTey</dc:creator>
      <dc:date>2020-06-22T05:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase time before token expires with Arcgis Python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/882358#M5177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maximum expiration time for tokens is set on the server, are you sure the server allows longer than 60 minutes?&amp;nbsp; If not, any request for longer time will simply return 60-minute token.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2020 14:19:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/882358#M5177</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-06-22T14:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase time before token expires with Arcgis Python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/1056418#M6037</link>
      <description>&lt;P&gt;I've got the same issue.. trying to run Portal site exports from the backend. The export takes around 65 minutes so I can't move on with the same token to export the Hosting site. Looks like you can't set the token timeout within the Python API -&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/1.6.2/arcgis.gis.toc.html#gis" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/1.6.2/arcgis.gis.toc.html#gis&lt;/A&gt;&amp;nbsp;On the generate token page it defaults to 1h and then options from there. But the Class doesn't have to extend the log in period. Would have been a nice to have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;10-05-2021 20:20:41 -- DEBUG: Staging Portal site at:- &lt;A href="https://server.domain:7443/arcgis/portaladmin" target="_blank"&gt;https://server.domain:7443/arcgis/portaladmin&lt;/A&gt; exported successfully.&lt;BR /&gt;Exported file: 10-May-2021-19-17-13-BST-FULL.portalsite&lt;/P&gt;&lt;P&gt;10-05-2021 20:20:41 -- DEBUG: REQUEST (get): &lt;A href="https://server.domain:7443/arcgis/portaladmin/federation/servers?f=json&amp;amp;token=maOGZlpLrHHj_UjxwmPGS_nOzf6WtWwodowK0HPOoYcVNtGskyKBRoLvEIW06VspdF9bWtQrt8myYSRNGs7roKkUhgw8Y3pRljjsIDU3rUrBhpN421SNmOIdb0FtU-uv" target="_blank"&gt;https://server.domain:7443/arcgis/portaladmin/federation/servers?f=json&amp;amp;token=maOGZlpLrHHj_UjxwmPGS_nOzf6WtWwodowK0HPOoYcVNtGskyKBRoLvEIW06VspdF9bWtQrt8myYSRNGs7roKkUhgw8Y3pRljjsIDU3rUrBhpN421SNmOIdb0FtU-uv&lt;/A&gt;&lt;BR /&gt;10-05-2021 20:20:42 -- INFO: Token expired during get request, fetching a new token and retrying&lt;BR /&gt;10-05-2021 20:20:42 -- DEBUG: REQUEST: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/&lt;/A&gt;, {'f': 'json'}&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: RESPONSE: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/&lt;/A&gt;, {"currentVersion":"6.1"}&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: REQUEST: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/generateToken" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/generateToken&lt;/A&gt;&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: RESPONSE: &lt;A href="https://server.domain:7443/arcgis/sharing/rest/generateToken" target="_blank"&gt;https://server.domain:7443/arcgis/sharing/rest/generateToken&lt;/A&gt;, {"token":"Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98","expires":1620678043117,"ssl":true}&lt;BR /&gt;10-05-2021 20:20:43 -- DEBUG: REQUEST (get): &lt;A href="https://server.domain:7443/arcgis/portaladmin/federation/servers?token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98?f=json&amp;amp;token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98" target="_blank"&gt;https://server.domain:7443/arcgis/portaladmin/federation/servers?token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98?f=json&amp;amp;token=Z-KPZFAxaB7cGkI_DjXf5J8nokAO1l3f2_K0qR2ZpnNMZeq0xfbD21DOKz5Ksl-ist1Xl2EfuVlxpiSxivGd6YN2KMe1yX9BnQgKDK6gE6_UBmD9FN0xeUwGlMIjsO98&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 20:18:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-increase-time-before-token-expires-with/m-p/1056418#M6037</guid>
      <dc:creator>PaulBatley</dc:creator>
      <dc:date>2021-05-10T20:18:59Z</dc:date>
    </item>
  </channel>
</rss>

