<?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: Invalid token error when connecting to GIS using GetSigninToken and ArcGIS Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/invalid-token-error-when-connecting-to-gis-using/m-p/1125679#M6903</link>
    <description>&lt;P&gt;line 8 is a enclosed in ( ) ...&amp;nbsp; (token['token'])&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/getsignintoken.htm" target="_blank" rel="noopener"&gt;GetSigninToken—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;try token['token'] without the ( ) ... just in case it matters on the receiving end (although it shouldn't be a tuple)&lt;/P&gt;</description>
    <pubDate>Tue, 14 Dec 2021 03:48:51 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-12-14T03:48:51Z</dc:date>
    <item>
      <title>Invalid token error when connecting to GIS using GetSigninToken and ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/invalid-token-error-when-connecting-to-gis-using/m-p/1125616#M6899</link>
      <description>&lt;P&gt;Running ArcGIS Pro 2.8 and ArcGIS Enterprise 10.9&lt;/P&gt;&lt;P&gt;This script should retrieve a token from an active Portal connection in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
# Get a Token
portalURL = arcpy.GetActivePortalURL()
token = arcpy.GetSigninToken()

if token is not None:
    token = (token['token'])
    gis = GIS(portalURL, token = token, verify_cert=False)
    print(token)
else:
    print('Fail.')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 8 fails with an invalid Token error. I can print the token and confirm it's valid. Any idea how I can use the token to connect to the GIS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Exception: Invalid token.
(Error Code: 498)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2024 23:26:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/invalid-token-error-when-connecting-to-gis-using/m-p/1125616#M6899</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2024-03-03T23:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid token error when connecting to GIS using GetSigninToken and ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/invalid-token-error-when-connecting-to-gis-using/m-p/1125679#M6903</link>
      <description>&lt;P&gt;line 8 is a enclosed in ( ) ...&amp;nbsp; (token['token'])&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/getsignintoken.htm" target="_blank" rel="noopener"&gt;GetSigninToken—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;try token['token'] without the ( ) ... just in case it matters on the receiving end (although it shouldn't be a tuple)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 03:48:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/invalid-token-error-when-connecting-to-gis-using/m-p/1125679#M6903</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-14T03:48:51Z</dc:date>
    </item>
  </channel>
</rss>

