<?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: Multifactor Auth in AGOL &amp; the Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1670487#M11804</link>
    <description>&lt;P&gt;I also need access to AGOL items via the ArcGIS API for Python while MFA is enabled on my account. Has there been any movement on this issue?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/400739"&gt;@HenryLindemann&lt;/a&gt;&amp;nbsp;Do you have any recommendations? I saw you were able to answer &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/enterprise-python-authentication/m-p/1024274#M5520" target="_self"&gt;a different authenication issue here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;The code below will provide access to items in the GIS (assuming the key was configured with access to the items). However, the lyr.manager.truncate() function errors while MFA is enabled. The function works successfully when MFA is not enabled.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;url = 'yourorg.arcgis.com'
apikey = 'apikey-fromA AGOL'
gis = arcgis.gis.GIS(url, api_key=apikey)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Dec 2025 14:56:33 GMT</pubDate>
    <dc:creator>BenCapell_NWTF10</dc:creator>
    <dc:date>2025-12-11T14:56:33Z</dc:date>
    <item>
      <title>Multifactor Auth in AGOL &amp; the Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/792090#M1615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there no way&amp;nbsp;to create GIS object connecting to an ArcGIS Online org, using the credentials of a user that has multi-factor authentication enabled? Our org requires administrators to use multi-factor authentication, but I can't find a way to log in to the org via the Python API. I keep getting this error:&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/460771_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there's not a way to do it, is there a plan to add a mechanism to do so?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:26:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/792090#M1615</guid>
      <dc:creator>GregMcNamee</dc:creator>
      <dc:date>2019-09-30T17:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multifactor Auth in AGOL &amp; the Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1326291#M8983</link>
      <description>&lt;P&gt;Hoi,&lt;/P&gt;&lt;P&gt;This issues is also very relevant for our organisation.&lt;/P&gt;&lt;P&gt;Do you maybe have an update for this item.&lt;/P&gt;&lt;P&gt;Jeroen Baltussen&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 10:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1326291#M8983</guid>
      <dc:creator>JeroenBaltussen1</dc:creator>
      <dc:date>2023-09-07T10:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multifactor Auth in AGOL &amp; the Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1418221#M9974</link>
      <description>&lt;P&gt;I cannot run scripts to AGOL and I suspect MFA is the issue.&amp;nbsp; Are there ways to utilize scripts with MFA implemented?&amp;nbsp; I use to use scripts like below to access REST services, and generate tokens for the irritating "Token Required" message at REST endpoints for services I published while I am online:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jonathan_Goergen_0-1714668766937.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102857i3063692DC4F616D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jonathan_Goergen_0-1714668766937.png" alt="Jonathan_Goergen_0-1714668766937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;params = {'f': 'pjson', 'username': userName, 'password': pw, 'referer': '&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;', 'expiration': 21600}&lt;BR /&gt;tokenURL = '&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" target="_blank"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;'&lt;BR /&gt;response = requests.post(tokenURL, data = params, verify = False)&lt;BR /&gt;token = response.json()['token']&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 16:52:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1418221#M9974</guid>
      <dc:creator>Jonathan_Goergen</dc:creator>
      <dc:date>2024-05-02T16:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multifactor Auth in AGOL &amp; the Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1670487#M11804</link>
      <description>&lt;P&gt;I also need access to AGOL items via the ArcGIS API for Python while MFA is enabled on my account. Has there been any movement on this issue?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/400739"&gt;@HenryLindemann&lt;/a&gt;&amp;nbsp;Do you have any recommendations? I saw you were able to answer &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/enterprise-python-authentication/m-p/1024274#M5520" target="_self"&gt;a different authenication issue here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;The code below will provide access to items in the GIS (assuming the key was configured with access to the items). However, the lyr.manager.truncate() function errors while MFA is enabled. The function works successfully when MFA is not enabled.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;url = 'yourorg.arcgis.com'
apikey = 'apikey-fromA AGOL'
gis = arcgis.gis.GIS(url, api_key=apikey)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2025 14:56:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1670487#M11804</guid>
      <dc:creator>BenCapell_NWTF10</dc:creator>
      <dc:date>2025-12-11T14:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multifactor Auth in AGOL &amp; the Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1673610#M11822</link>
      <description>&lt;P&gt;I found that using the OAUTH2.0 scheme works best for my process. With MFA enabled and the developer credential item in AGOL I am able to complete the lyr.manager.truncate() call after accessing the content through the GIS object that has been authenticated with the OATH2 token.&amp;nbsp;&lt;BR /&gt;The process detailed here was most helpful:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-authentication-by-oauth2-0-quot/m-p/1416113/highlight/true#M9952" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-authentication-by-oauth2-0-quot/m-p/1416113/highlight/true#M9952&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Additional OAUTH background links from the Esri Developer site:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/latest/guide/working-with-different-authentication-schemes/#user-authentication-with-oauth-20" target="_blank"&gt;https://developers.arcgis.com/python/latest/guide/working-with-different-authentication-schemes/#user-authentication-with-oauth-20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/#oauth-credentials" target="_blank"&gt;https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/#oauth-credentials&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/oauth-credentials-user/" target="_blank"&gt;https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/oauth-credentials-user/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 15:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/multifactor-auth-in-agol-the-python-api/m-p/1673610#M11822</guid>
      <dc:creator>BenCapell_NWTF10</dc:creator>
      <dc:date>2025-12-17T15:04:21Z</dc:date>
    </item>
  </channel>
</rss>

