Can't save the project area when trying to add a user as project admin using cURL
I am trying to add a user to a project area using a Perl script that executes a cURL command. I am a member of the JazzAdmins group but I am not defined in the project area in question as a project administrator and I am trying to add myself as a project administrator. When I do I get an error that tells me that I do not have permission to do so.
|
One answer
Using RESTClient with Firefox, I actually get a different error message.
Permission Denied
Your account does not have the group memberships required to access the requested resource.
And I can confirm that adding the header "X-Jazz-CSRF-Prevent" does resolve the issue. Maybe you need to check the error message in the ccm.log file as it is far more detailed than the one on the client. Comments
Ryan McBryde
commented Mar 02 '17, 10:11 a.m.
Thank you Donald,
Also,
Donald Nong
commented Mar 03 '17, 3:29 a.m.
Ryan, I have to say, you lied a bit. :-)
To access the server logs of an application you don't have to have access to the physical machine. As JazzAdmin use the applications Diagnostics Export Results. the log files are in a zip file in the downloaded zip file.
Ryan McBryde
commented Mar 03 '17, 4:55 p.m.
Ralph,
Thank you for the reminder of the export capability!
Ryan McBryde
commented Mar 03 '17, 5:04 p.m.
Donald,
You suggest that it is easy to add myself as the project admin, then make whatever changes I need to, including removing another project admin, and then remove myself.
Do I need to execute the add of my id as project admin using the X-Jazz-CSRF-Prevent option?
Ryan McBryde
commented Mar 03 '17, 5:27 p.m.
Here is my batch file, which doesn't work
1
Donald Nong
commented Mar 03 '17, 11:19 p.m.
Ah...you're moving target again! This time is RM. I suggest you do a GET first to verify that you indeed log on to RM already (you log on to JTS in the script), then get the JSESSIONID.
Ryan McBryde
commented Mar 07 '17, 2:07 p.m.
Donald,
Thank you. It was not my intent to deceive but my goal is to have one script that I can use to add/delete users to any project area for any application (ccm, rm, qm).
THANK YOU also for the tip on logging into rm instead of jts, that helped.
Am I correct in assuming that I will need to log into each application to manage it?
I am getting a "Error 404: Not Found" when I run this cURL command,
curl -k -L -b ./cookies.txt -c ./cookies.txt -d j_username=<ID> -d j_password=<PASSWD> -ssl "https://<SERVER>/rm/authenticated/j_security_check"
This is after running:
curl -k -c ./cookies.txt -ssl "https://<SERVER>/rm/authenticated/identity"
without any error.
Yet, the script still added my user as an admin successfully.
Donald Nong
commented Mar 08 '17, 12:51 a.m.
The reason I suggest logging to each application is that they may be distributed and you will get a different JSESSIONID from each application server (WAS/Liberty/Tomcat), and we know that it's crucial for the "X-Jazz-CSRF-Prevent" header.
showing 5 of 10
show 5 more comments
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.