Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

HEADLESS authentication to RTC CCM service using e.g. curl

 Could you please provide the correct method in order to authenticate to the title RTC CCM service in the headless mode?

I am developing a script that would automate some work (downloading work items' attachments to be precise). In order to do so I tried to authenticate to the server using htpps request with cookies:

curl -kv -c <COOKIE_FILE> <RTC_SERVER>/ccm/authenticated/identity

curl -kv -L -b <COOKIE_FILE> -c <COOKIE_FILE> -d j_username=<username> -d j_password=<password> <RTC_SERVER>/ccm/authenticated/j_security_check

but the reposonse I get from the second requests states e.g.:

<noscript><div id="net-jazz-ajax-NoScriptMessage">Javascript is either disabled or not available in your Browser</div></noscript>

In advance thank you.
Best regards!

0 votes


Accepted answer

Permanent link
I just used this, which is almost exactly the same as your commands, and it worked perfectly:

set USER=<username>
set PWD=<password>
rem File which will contain the login cookies
set COOKIES=cookies.txt
 
rem First pass to request the authentication cookie
curl.exe -k -c %COOKIES% https://<server>/ccm/authenticated/identity

rem Second pass to login
curl.exe -k -L -b %COOKIES% -c %COOKIES% -d j_username=%USER% -d j_password=%PWD% https://<server>/ccm/authenticated/j_security_check
 
rem Request the url using the authentication
curl.exe -k -b %COOKIES% https://<server>/ccm/oslc/workitems/catalog
Marek Bocian selected this answer as the correct answer

0 votes


One other answer

Permanent link

I (as well as my collegaus experiencing the same issue) performed the very same requests on our Windows machines as @Davyd suggested and, indeed, it succeded.


The most bizzare thing is that after the authentication process from Windows platform it works now in the Linux shell as well... ( Yeah, I know how it sounds. :D )
The auth process outcome has been fully verified since now I am able to query all the resources of the given RTC project through OSLC REST API.

Again, thank you for your support!

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019
× 7,495
× 1,325
× 152

Question asked: Aug 31 '20, 10:17 a.m.

Question was seen: 2,470 times

Last updated: Sep 01 '20, 8:57 a.m.

Confirmation Cancel Confirm