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

Authentification to Rational Team Concert with Javascript and REST Api

I'm building a Web application to access some informations about project-areas/team-areas | WorkItems | etc... I want to get thoses informations with Javascript and I used the REST Api / OSLC.

I'm facing some troubles with the authentification.
I don't know how can I create and manage the authentification to the server.
I have the username and password but what should I do with that ?

Is there a guide or tutorial to use the REST api with javascript ?

I tried to use curl in a php file but it didn't work (it returned me an empty string maybe because I was not logged at that time ?)...

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://<server>/ccm/rpt/repository");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, 0);
$response = curl_exec($ch);
curl_close($ch);
echo $response;


Thanks in advance for your help !

0 votes



2 answers

Permanent link

Check out this post and see if it helps.
https://jazz.net/forum/questions/170030/rtc-oslc-authenticate-with-javascript

If the JavaScript is running as part of RTC (as a OpenSocial Widget for example), you can check out these posts.
https://jazz.net/forum/questions/215022/access-rtc-with-oslc-using-javascript
https://jazz.net/forum/questions/212195/how-to-create-work-item-using-javascript-within-an-opensocial-gadget

But reading your post, I have the impression that you get confused about what you are doing. If you use Perl, it runs on the server where your own web application runs, there should be no involvement of JavaScript at all. In this case, there are plenty of sample Perl scripts on jazz.net. If you indeed want to use JavaScript on the client side (a browser) of your own web application, it means that it reads data from RTC, then feeds back to the backend (server side) of your application - that's a lot of work to do. I don't know why you would make it so complicated.

0 votes


Permanent link

There some sample code at https://github.com/OSLC/oslc-client that might be helpful. This uses JEE Form based authentication to connect a JavaScript client to RTC.


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
× 515
× 478
× 152

Question asked: Feb 02 '17, 4:51 a.m.

Question was seen: 4,593 times

Last updated: Feb 07 '17, 11:58 a.m.

Confirmation Cancel Confirm