Select to view content in your preferred language

Issue with OAuth "Private application with selected privileges

129
0
a week ago
ChaceCarpenter
Occasional Contributor

Hey everyone,

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 "Private application with selected privileges and access" configuration to run a Python script that exports a hosted feature layer to a File Geodatabase (FGDB).

Even after granting specific privileges to the credentials, the script fails with:

AttributeError: 'NoneType' object has no attribute 'username'

This error is the result of a permission error

Here is what I've tried so far to troubleshoot:

  • Privilege Check: I recreated the credentials and granted all available privileges, but the error persists.

  • Direct Auth: When I bypass OAuth and use my Administrator account credentials directly in the script, the export works perfectly.

  • Application Type Change: If I switch the OAuth type to "Private application that impersonates you," the export operation also works as expected.

I’ve even reproduced this on my end consistently. I’m really trying to stick with the "selected privileges and access" route because I want to maintain a "least privilege" security model and avoid giving the script the full run of my Admin account.

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!

0 Kudos
0 Replies