<?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 Issue with OAuth &amp;quot;Private application with selected privileges in ArcGIS Online Developers Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-developers-questions/issue-with-oauth-quot-private-application-with/m-p/1701684#M1621</link>
    <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;I’m hitting a wall with an OAuth 2.0 implementation in ArcGIS Online and wanted to see if anyone else has run into this. I'm trying to use a &lt;STRONG&gt;"Private application with selected privileges and access"&lt;/STRONG&gt; configuration to run a Python script that exports a hosted feature layer to a File Geodatabase (FGDB).&lt;/P&gt;&lt;P&gt;Even after granting specific privileges to the credentials, the script fails with:&lt;/P&gt;&lt;P&gt;AttributeError: 'NoneType' object has no attribute 'username'&lt;/P&gt;&lt;P&gt;This error is the result of a permission error&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is what I've tried so far to troubleshoot:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Privilege Check:&lt;/STRONG&gt; I recreated the credentials and granted &lt;I&gt;all&lt;/I&gt; available privileges, but the error persists.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Direct Auth:&lt;/STRONG&gt; When I bypass OAuth and use my &lt;STRONG&gt;Administrator account credentials&lt;/STRONG&gt; directly in the script, the export works perfectly.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Application Type Change:&lt;/STRONG&gt; If I switch the OAuth type to &lt;STRONG&gt;"Private application that impersonates you,"&lt;/STRONG&gt; the export operation also works as expected.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I’ve even reproduced this on my end consistently. I’m really trying to stick with the &lt;STRONG&gt;"selected privileges and access"&lt;/STRONG&gt; route because I want to maintain a "least privilege" security model and avoid giving the script the full run of my Admin account.&lt;/P&gt;&lt;P&gt;Does anyone know why the "selected privileges" app type might be failing to resolve the username attribute in the Python API, even when full privileges are assigned? Any insights would be appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2026 03:29:13 GMT</pubDate>
    <dc:creator>ChaceCarpenter</dc:creator>
    <dc:date>2026-05-13T03:29:13Z</dc:date>
    <item>
      <title>Issue with OAuth "Private application with selected privileges</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/issue-with-oauth-quot-private-application-with/m-p/1701684#M1621</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;I’m hitting a wall with an OAuth 2.0 implementation in ArcGIS Online and wanted to see if anyone else has run into this. I'm trying to use a &lt;STRONG&gt;"Private application with selected privileges and access"&lt;/STRONG&gt; configuration to run a Python script that exports a hosted feature layer to a File Geodatabase (FGDB).&lt;/P&gt;&lt;P&gt;Even after granting specific privileges to the credentials, the script fails with:&lt;/P&gt;&lt;P&gt;AttributeError: 'NoneType' object has no attribute 'username'&lt;/P&gt;&lt;P&gt;This error is the result of a permission error&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is what I've tried so far to troubleshoot:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Privilege Check:&lt;/STRONG&gt; I recreated the credentials and granted &lt;I&gt;all&lt;/I&gt; available privileges, but the error persists.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Direct Auth:&lt;/STRONG&gt; When I bypass OAuth and use my &lt;STRONG&gt;Administrator account credentials&lt;/STRONG&gt; directly in the script, the export works perfectly.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Application Type Change:&lt;/STRONG&gt; If I switch the OAuth type to &lt;STRONG&gt;"Private application that impersonates you,"&lt;/STRONG&gt; the export operation also works as expected.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I’ve even reproduced this on my end consistently. I’m really trying to stick with the &lt;STRONG&gt;"selected privileges and access"&lt;/STRONG&gt; route because I want to maintain a "least privilege" security model and avoid giving the script the full run of my Admin account.&lt;/P&gt;&lt;P&gt;Does anyone know why the "selected privileges" app type might be failing to resolve the username attribute in the Python API, even when full privileges are assigned? Any insights would be appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2026 03:29:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/issue-with-oauth-quot-private-application-with/m-p/1701684#M1621</guid>
      <dc:creator>ChaceCarpenter</dc:creator>
      <dc:date>2026-05-13T03:29:13Z</dc:date>
    </item>
  </channel>
</rss>

