<?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 Exception: User not allowed for this account using arcgis.gis in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-user-not-allowed-for-this-account-using/m-p/1381571#M9651</link>
    <description>&lt;P&gt;I'm trying to connect to Portal for ArcGIS using the Python ArcGIS API and a user administrator account.&lt;/P&gt;&lt;P&gt;However, when I try to authenticate with the Python code, I get error: "&lt;STRONG&gt;Exception: User not allowed for this account&lt;/STRONG&gt;"&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;URL= '&lt;A href="https://domain.name.com/portalgis" target="_blank"&gt;https://domain.name.com/portalgis&lt;/A&gt;'&lt;BR /&gt;ARCGIS_USER = 'user'&lt;BR /&gt;ARCGIS_PASSWORD = 'password'&lt;/P&gt;&lt;P&gt;gis = GIS (url=URL, username=ARCGIS_USER, password=ARCGIS_PASSWORD)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I try to connect with API Rest, I can:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;headers = {'content-type': 'application/form-data'}&lt;BR /&gt;payload = {&lt;BR /&gt;'f': 'json',&lt;BR /&gt;"username": ARCGIS_USER,&lt;BR /&gt;'password': ARCGIS_PASSWORD,&lt;BR /&gt;'client': 'reference',&lt;BR /&gt;'reference': URL,&lt;BR /&gt;"expiry": 21600&lt;BR /&gt;}&lt;BR /&gt;req = requests.post('{}/sharing/rest/generateToken'.format(URL),data=payload, verify=False)&lt;BR /&gt;&lt;BR /&gt;# Extract the token&lt;BR /&gt;token = json.loads(req.content.decode('utf-8'))&lt;BR /&gt;token = token['token']&lt;BR /&gt;print ('--&amp;gt; TOKEN {}'.format(token))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Setting portal logging in debug mode, I'm getting: "&lt;EM&gt;com.esri.gw.oauth2.OAuth2Exception: Invalid redirect_uri at com.esri.gw.filters.SecurityFilter.doFilter(SecurityFilter.java:100) at&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;... at&amp;nbsp; java.base/java.lang.Thread.run(Unknown Source)"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I'm using ArcGIS Enterprise v11.2. This problem occurs after upgrade from v10.8.1 (&lt;EM&gt;The&lt;STRONG&gt; privatePortalURL&lt;/STRONG&gt; of portaladmin Home &amp;gt; System &amp;gt; Properties is set correctly&lt;/EM&gt;).&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 14:48:22 GMT</pubDate>
    <dc:creator>FrancescPuigvert</dc:creator>
    <dc:date>2024-02-13T14:48:22Z</dc:date>
    <item>
      <title>Exception: User not allowed for this account using arcgis.gis</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-user-not-allowed-for-this-account-using/m-p/1381571#M9651</link>
      <description>&lt;P&gt;I'm trying to connect to Portal for ArcGIS using the Python ArcGIS API and a user administrator account.&lt;/P&gt;&lt;P&gt;However, when I try to authenticate with the Python code, I get error: "&lt;STRONG&gt;Exception: User not allowed for this account&lt;/STRONG&gt;"&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;URL= '&lt;A href="https://domain.name.com/portalgis" target="_blank"&gt;https://domain.name.com/portalgis&lt;/A&gt;'&lt;BR /&gt;ARCGIS_USER = 'user'&lt;BR /&gt;ARCGIS_PASSWORD = 'password'&lt;/P&gt;&lt;P&gt;gis = GIS (url=URL, username=ARCGIS_USER, password=ARCGIS_PASSWORD)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I try to connect with API Rest, I can:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;headers = {'content-type': 'application/form-data'}&lt;BR /&gt;payload = {&lt;BR /&gt;'f': 'json',&lt;BR /&gt;"username": ARCGIS_USER,&lt;BR /&gt;'password': ARCGIS_PASSWORD,&lt;BR /&gt;'client': 'reference',&lt;BR /&gt;'reference': URL,&lt;BR /&gt;"expiry": 21600&lt;BR /&gt;}&lt;BR /&gt;req = requests.post('{}/sharing/rest/generateToken'.format(URL),data=payload, verify=False)&lt;BR /&gt;&lt;BR /&gt;# Extract the token&lt;BR /&gt;token = json.loads(req.content.decode('utf-8'))&lt;BR /&gt;token = token['token']&lt;BR /&gt;print ('--&amp;gt; TOKEN {}'.format(token))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Setting portal logging in debug mode, I'm getting: "&lt;EM&gt;com.esri.gw.oauth2.OAuth2Exception: Invalid redirect_uri at com.esri.gw.filters.SecurityFilter.doFilter(SecurityFilter.java:100) at&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;... at&amp;nbsp; java.base/java.lang.Thread.run(Unknown Source)"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I'm using ArcGIS Enterprise v11.2. This problem occurs after upgrade from v10.8.1 (&lt;EM&gt;The&lt;STRONG&gt; privatePortalURL&lt;/STRONG&gt; of portaladmin Home &amp;gt; System &amp;gt; Properties is set correctly&lt;/EM&gt;).&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 14:48:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-user-not-allowed-for-this-account-using/m-p/1381571#M9651</guid>
      <dc:creator>FrancescPuigvert</dc:creator>
      <dc:date>2024-02-13T14:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User not allowed for this account using arcgis.gis</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-user-not-allowed-for-this-account-using/m-p/1381742#M9652</link>
      <description>&lt;P&gt;Solved. Connect without webadaptor. Post [&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/cannot-log-in-with-different-arcgis-portal-user/m-p/801145#M2075" target="_self"&gt;url&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Does your Portal use Integrated Windows Authentication? If so, try replacing the URL with the fully qualified domain name and port number. (&lt;A href="https://portalMachine.domain:7443/arcgis/home" target="_blank"&gt;https://portalMachine.domain:7443/arcgis/home&lt;/A&gt;) You should not be automatically authenticated as the viewer account when using this URL.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;-Josh&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is: &lt;A href="https://machinename" target="_blank" rel="noopener"&gt;https://machinename&lt;/A&gt;: port/arcgis.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 18:27:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-user-not-allowed-for-this-account-using/m-p/1381742#M9652</guid>
      <dc:creator>FrancescPuigvert</dc:creator>
      <dc:date>2024-02-13T18:27:02Z</dc:date>
    </item>
  </channel>
</rss>

