Hi,
I want to add a user as a direct member to a group via rest API.
I'm using crowd admin for authorization (basic mode). But the result is: Application failed to authenticate! "401".
I can log in to crowd using crowd admin username and password. I don't know how to fix this status.
Any suggestion?
curl --location --request POST 'https://localhost/crowd/rest/usermanagement/1/group/user/direct?groupname=samplegroup' \--header 'Authorization: Basic username&password' \--header 'Content-Type: application/json'\ --data-raw '{"name": "sampleuser"}'
I have the same problem, any solution found?
The username password you're using is the application username password correct? These are defined as applications in crowd, not as users in crowd.
I wrote a wrapper in Rust as well as leveraged ScriptRunner and HttpURLConnection to do REST API calls with our Crowd instance. In the base formatting for my json and URL looked similar to below:
URL:
http://crowdBaseUrl/crowd/rest/usermanagement/latest/user/group/direct?username="user unique ID"
JSON:
"{"name": "NAME OF GROUP", "description": "LEFT BLANK", "type": "GROUP", "active": "true"}"
Same error
401 UnauthorizedApplication failed to authenticate
using Crowd REST API https://docs.atlassian.com/atlassian-crowd/5.1.0/REST/#usermanagement/1/group-addUserAsDirectGroupMember.Credentials are correct since other Crowd REST APIs work as expected.
Any advice?Thanks in advance.Cheers.
URL:http://crowdBaseUrl/crowd/rest/usermanagement/latest/user/group/direct?username="user unique ID"JSON:"{"name": "NAME OF GROUP", "description": "LEFT BLANK", "type": "GROUP", "active": "true"}"
So, Crowd REST API https://docs.atlassian.com/atlassian-crowd/5.1.0/REST/#usermanagement/1/user-addUserToGroup is working for you?
Thanks in advance.Cheers.
Gotcha!
Please note that the usermanagement resource expects the callers to authenticate using the application credentials (i.e. the application name and password configured in Crowd). Calls to this APIs are restricted by IP as configured.Other resources expect the callers to authenticate using the user credentials.
Please note that the usermanagement resource expects the callers to authenticate using the application credentials (i.e. the application name and password configured in Crowd). Calls to this APIs are restricted by IP as configured.
usermanagement
Other resources expect the callers to authenticate using the user credentials.
Yeap! Been working since we deployed the applet to do the group assignments! Is yours not? Have you manually executed the REST API call in the browser to validate that you're hitting the API correctly?
Solved, see https://community.atlassian.com/t5/Crowd-questions/Re-Re-Add-user-to-group-Crowd-Rest-API/qaq-p/2272428/comment-id/6280#M6280
Thanks for reply.
Hi @Penn , thanks for your answer. I am using Crowd Admin User (internal user!)
What is Application username exactly?
@Parvaneh Zand when you look at your crowd installation, in the web interface you have "Applications" at the top. Within Applications you define each application and the access controls for the application. The "Name" in each application as well as the "Password" for that application are what I'm referring to. I believe these are the access control values you need to be supplying.
It looks like you're new here. Sign in or register to get started.