Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for portal service operations with API keys/App authentication #1182

Open
gowin20 opened this issue Nov 14, 2024 · 0 comments
Open
Assignees

Comments

@gowin20
Copy link

gowin20 commented Nov 14, 2024

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 and getUsername method of IdentityManager:

return requestOptions.authentication.getUsername();

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:
image

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.

Alternatives considered

No response

Additional Information

No response

@patrickarlt patrickarlt self-assigned this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants