As of the latest ArcGIS Online release, both API keys and app authentication (with Online+Location Platform accounts) now support performing portal service operations, e.g. managing items, users, groups, etc... They also support spatial analysis operations.
All of the portal service operations that require a username currently fail when using an API key/ApplicationCredentialsManager. The following error is what we're getting when running createItem with an API key:
Describe the proposed solution
The ApiKeyManager and ApplicationCredentialsManager classes need to be updated to add support for a getUsername property. Hopefully this can be completed in a minimally breaking way. We should also update our internal codebase to rely on getUsername instead of the username method across the board, as getUsername is async.
Describe the problem
As of the latest ArcGIS Online release, both API keys and app authentication (with Online+Location Platform accounts) now support performing portal service operations, e.g. managing items, users, groups, etc... They also support spatial analysis operations.
REST JS supports portal operations but requires a username for many/all of them. This property is currently accessed through the
username
property andgetUsername
method of IdentityManager: https://github.com/Esri/arcgis-rest-js/blob/bfd7ce977d9879077e92fabfc491240d8f230844/packages/arcgis-rest-portal/src/items/helpers.ts#L264All of the portal service operations that require a username currently fail when using an API key/ApplicationCredentialsManager. The following error is what we're getting when running
createItem
with an API key:Describe the proposed solution
The
ApiKeyManager
andApplicationCredentialsManager
classes need to be updated to add support for agetUsername
property. Hopefully this can be completed in a minimally breaking way. We should also update our internal codebase to rely ongetUsername
instead of theusername
method across the board, asgetUsername
is async.Alternatives considered
No response
Additional Information
No response