<?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 Why my Portal for ArcGIS admin credentials are not accepted when using API? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/why-my-portal-for-arcgis-admin-credentials-are-not/m-p/1336634#M9128</link>
    <description>&lt;P&gt;I am a new user and i'm trying to programmatically interact with Portal for ArcGIS and also ArcGIS server using my admin credentials.&lt;/P&gt;&lt;P&gt;My Windows user account &lt;A href="mailto:name.surname@company.com" target="_blank"&gt;name.surname@company.com&lt;/A&gt;&amp;nbsp;has an Admin role and I have confirmed that i am able to login to &lt;A href="https://company.server.com/portal/portaladmin/" target="_blank"&gt;https://company.server.com/portal/portaladmin/&lt;/A&gt; via web-browser.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, when i attempt to authenticate myself via Python code, get errors like "Admin credentials not accepted.", "Exception: Access not allowed request", "(Error Code: 403)".&lt;/P&gt;&lt;P&gt;Please note that when i am using a generated token instead of my admin credentials, i do get Response 200 and the requested data.&lt;/P&gt;&lt;P&gt;So why can't i authenticate with my admin credentials?&lt;/P&gt;&lt;P&gt;I am using ArcGIS Enterprise v11.1&lt;/P&gt;&lt;P&gt;My code looks like this (i also tried various variations, like not providing username &amp;amp; password or using built-in/shared admin credentials):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from arcgis.gis import GIS&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;portal_url = '&lt;A href="https://company.server.com/portal/portaladmin/" target="_blank"&gt;https://company.server.com/portal/portaladmin/&lt;/A&gt;'&lt;BR /&gt;username = 'admin'&lt;BR /&gt;password = 'Pass1#'&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;&lt;BR /&gt;gis = GIS(portal_url, username, password)&lt;BR /&gt;&lt;BR /&gt;print("Admin credentials accepted. Success!")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;except Exception as e:&lt;/P&gt;&lt;P&gt;print(f"Admin credentials not accepted. Error: {str(e)}")&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2023 16:33:40 GMT</pubDate>
    <dc:creator>TZ</dc:creator>
    <dc:date>2023-10-10T16:33:40Z</dc:date>
    <item>
      <title>Why my Portal for ArcGIS admin credentials are not accepted when using API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/why-my-portal-for-arcgis-admin-credentials-are-not/m-p/1336634#M9128</link>
      <description>&lt;P&gt;I am a new user and i'm trying to programmatically interact with Portal for ArcGIS and also ArcGIS server using my admin credentials.&lt;/P&gt;&lt;P&gt;My Windows user account &lt;A href="mailto:name.surname@company.com" target="_blank"&gt;name.surname@company.com&lt;/A&gt;&amp;nbsp;has an Admin role and I have confirmed that i am able to login to &lt;A href="https://company.server.com/portal/portaladmin/" target="_blank"&gt;https://company.server.com/portal/portaladmin/&lt;/A&gt; via web-browser.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, when i attempt to authenticate myself via Python code, get errors like "Admin credentials not accepted.", "Exception: Access not allowed request", "(Error Code: 403)".&lt;/P&gt;&lt;P&gt;Please note that when i am using a generated token instead of my admin credentials, i do get Response 200 and the requested data.&lt;/P&gt;&lt;P&gt;So why can't i authenticate with my admin credentials?&lt;/P&gt;&lt;P&gt;I am using ArcGIS Enterprise v11.1&lt;/P&gt;&lt;P&gt;My code looks like this (i also tried various variations, like not providing username &amp;amp; password or using built-in/shared admin credentials):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from arcgis.gis import GIS&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;portal_url = '&lt;A href="https://company.server.com/portal/portaladmin/" target="_blank"&gt;https://company.server.com/portal/portaladmin/&lt;/A&gt;'&lt;BR /&gt;username = 'admin'&lt;BR /&gt;password = 'Pass1#'&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;&lt;BR /&gt;gis = GIS(portal_url, username, password)&lt;BR /&gt;&lt;BR /&gt;print("Admin credentials accepted. Success!")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;except Exception as e:&lt;/P&gt;&lt;P&gt;print(f"Admin credentials not accepted. Error: {str(e)}")&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 16:33:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/why-my-portal-for-arcgis-admin-credentials-are-not/m-p/1336634#M9128</guid>
      <dc:creator>TZ</dc:creator>
      <dc:date>2023-10-10T16:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why my Portal for ArcGIS admin credentials are not accepted when using API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/why-my-portal-for-arcgis-admin-credentials-are-not/m-p/1336672#M9129</link>
      <description>&lt;P&gt;I think we need more information about your authentication scheme to provide any insights. You mention using a Windows account - are you using IWA, portal tier with AD, something else?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 18:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/why-my-portal-for-arcgis-admin-credentials-are-not/m-p/1336672#M9129</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2023-10-10T18:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why my Portal for ArcGIS admin credentials are not accepted when using API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/why-my-portal-for-arcgis-admin-credentials-are-not/m-p/1336820#M9131</link>
      <description>&lt;P&gt;yes, i am using IWA - i login to all apps via SSO, including ArcGIS Enterprise&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 03:43:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/why-my-portal-for-arcgis-admin-credentials-are-not/m-p/1336820#M9131</guid>
      <dc:creator>TZ</dc:creator>
      <dc:date>2023-10-11T03:43:02Z</dc:date>
    </item>
  </channel>
</rss>

