<?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 Authentication for AddtoDefinition in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/authentication-for-addtodefinition/m-p/1301930#M8813</link>
    <description>&lt;P&gt;I'm attempting to add a relationship between two items in a hosted feature layer via the addToDefinition command in a script. I have the correct JSON, and I can apply it myself via the Rest directory of the feature layer. When I try and run it from ArcGIS Pro, passing my pro credentials to the script:&lt;BR /&gt;&lt;BR /&gt;gis = GIS('pro')&lt;BR /&gt;&lt;BR /&gt;and using the:&amp;nbsp;&lt;/P&gt;&lt;P&gt;token = gis._con.token&lt;BR /&gt;&lt;BR /&gt;command it doesn't work. If I hardcode my username and password into the script instead:&lt;BR /&gt;&lt;BR /&gt;gis = GIS("&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;", username, password) it does work...every time!&lt;/P&gt;&lt;P&gt;What is the difference between the two methods? It's the same account, so surely the token it generates to make the change will be identical. I would rather not have to hardcode a username and password in and have it just inherit Pro's connection properties. I also tried using the:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.GetSigninToken() command, but again it doesn't work when I pass this as the token&lt;BR /&gt;&lt;BR /&gt;Any help is much appreciated&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 12:06:26 GMT</pubDate>
    <dc:creator>RichardHoweRSKECO</dc:creator>
    <dc:date>2023-06-22T12:06:26Z</dc:date>
    <item>
      <title>Authentication for AddtoDefinition</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/authentication-for-addtodefinition/m-p/1301930#M8813</link>
      <description>&lt;P&gt;I'm attempting to add a relationship between two items in a hosted feature layer via the addToDefinition command in a script. I have the correct JSON, and I can apply it myself via the Rest directory of the feature layer. When I try and run it from ArcGIS Pro, passing my pro credentials to the script:&lt;BR /&gt;&lt;BR /&gt;gis = GIS('pro')&lt;BR /&gt;&lt;BR /&gt;and using the:&amp;nbsp;&lt;/P&gt;&lt;P&gt;token = gis._con.token&lt;BR /&gt;&lt;BR /&gt;command it doesn't work. If I hardcode my username and password into the script instead:&lt;BR /&gt;&lt;BR /&gt;gis = GIS("&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;", username, password) it does work...every time!&lt;/P&gt;&lt;P&gt;What is the difference between the two methods? It's the same account, so surely the token it generates to make the change will be identical. I would rather not have to hardcode a username and password in and have it just inherit Pro's connection properties. I also tried using the:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.GetSigninToken() command, but again it doesn't work when I pass this as the token&lt;BR /&gt;&lt;BR /&gt;Any help is much appreciated&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 12:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/authentication-for-addtodefinition/m-p/1301930#M8813</guid>
      <dc:creator>RichardHoweRSKECO</dc:creator>
      <dc:date>2023-06-22T12:06:26Z</dc:date>
    </item>
  </channel>
</rss>

