api methods crowd (GET /rest/admin/1.0/groups/{groupId}/users )
do not work on behalf of the application .
I am trying to call api methods from my python application and they throw a 401 error. According to the documentation - this is caused by a lack of rights. But I have checked all the rights. All other methods work, except for the methods / rest / admin / **
From under the normal user account through curl these methods (/ rest / admin / **) -work.
version crowd -3.3.2
Help me please
Yes, this behavior is expected in Crowd. The key distinction is:
/rest/usermanagement/** is intended for application-based REST access./rest/admin/** is intended for administrative operations, and Crowd docs state that non-usermanagement resources expect user credentials, with permissions based on that user’s permissions. [docs.atlassian.com]So if your Python app authenticates with the Crowd application name/password, calls like this can fail:
even though normal usermanagement APIs work.
You mentioned that the same /rest/admin/** method works from curl under a normal user account. That matches the documentation: admin APIs authenticate as a Crowd user, not as an application. [docs.atlassian.com]
So this works:
But this may fail:
because application credentials are for the usermanagement API, not the admin API. Crowd’s REST documentation explicitly says the usermanagement resource expects application credentials, while other resources expect user credentials. [docs.atlassian.com]
/rest/admin/**In Python:
Use a Crowd user that has the required admin or group-level admin permissions.
/rest/usermanagement/** if you need application-based accessIf your Python app should authenticate as a Crowd application, use endpoints under:
For example, Crowd 3.3.0 documents these group membership-related endpoints under usermanagement:
These belong to the application-facing API. [docs.atlassian.com]
Use the right API namespace
Application credentials:
User/admin credentials:
Check the actual HTTP status
Crowd’s general REST API guide says 401 Unauthorized can indicate invalid application name/password or that the application does not exist in the application-authenticated API context. It also documents 403 Forbidden for cases such as inactive application or caller IP not allowed. [developer....assian.com]
Make sure you are using groupId, not group name
The admin endpoint is:
so {groupId} should be the Crowd group ID expected by that admin API, not necessarily the group name.
You cannot reliably call /rest/admin/** “on behalf of the application” using Crowd application credentials. For those endpoints, authenticate with a Crowd user account that has the required permissions. If you need application-based authentication, use the /rest/usermanagement/** APIs instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.