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

RTC OAuth consumer error

I am trying to retrieve the OSLC catalog from the RTC url :
https://rtc:9444/ccm/oslc/workitems/catalog using OAuth. I generated a consumer (Inbound) key with a secret.

I supplied this key and invoked the getRequestToken on the OAuthClient but I got back a 'invalid_consumer_key' message.

I skipped this step an invoked the access method, I got back a 'parameter absent' message. I sent the consumer key,secret,realm,oauth parameters as per the OAuth specification.

Can someone please guide me on the correct way to retrieve the catalog ?

0 votes



4 answers

Permanent link
Have you looked at https://jazz.net/library/article/635 ?
You might also want to provide more context on what you are trying to do and how.

0 votes


Permanent link
Have you looked at https://jazz.net/library/article/635 ?
You might also want to provide more context on what you are trying to do and how.


Thanks Ralph. I will look into the article.

I need to write a client application that lists the Project areas (and downwards like Defects etc) present on my RTC server. I intend to do this starting from the CCM Rootservices and extracting the CM providers. I have been able to retrieve the CCM rootservices document and from that the catalog URL. This is the snippet of the code I use.


OAuthServiceProvider serviceProvider = new OAuthServiceProvider(RURL, UURL, AURL);
OAuthConsumer consumer = new OAuthConsumer(null, "secret", "key", serviceProvider);

OAuthAccessor accessor = new OAuthAccessor(consumer);

//Setup the client that is set up with SSL.
OAuthClient client = new OAuthClient(new HttpClient3(new MyCustomSSLClient()));
//Attempt to get a request token from the provider
try {
try {
client.getRequestToken(accessor); -> throws exception 'invalid consumer key'
} catch (OAuthProblemException e) {

Collection<OAuth> parameters = new ArrayList<OAuth>();
OAuth.Parameter param = new OAuth.Parameter("oauth_consumer_key", consumer.consumerKey);
parameters.add(param);
param = new OAuth.Parameter("oauth_consumer_secret", consumer.consumerSecret);
parameters.add(param);
param = new OAuth.Parameter("realm", "Jazz%20Team%20Server");
parameters.add(param);
param = new OAuth.Parameter("oauth", "OAuth");
parameters.add(param);
OAuthMessage req = new OAuthMessage(OAuthMessage.GET, uri, parameters); -> uri is the catalog url
OAuthMessage request = client.access(req, ParameterStyle.BODY); -> throws exception 'parameter absent'

0 votes


Permanent link
You might want to consider posting questions like that in the Extending Team Concert forum. That forum is also a good source to search for similar questions. The Advanced Search might be useful too. i would also search developerworks for articles.

I assume you would provide a user ID and a password. you would not need a registration as friend. If you register as friend I would assume you need to set a functional user ID. However, O have not had time to play much with OSLC.

0 votes


Permanent link
Thanks Ralph - I will look to post it on the other forum. The article link that you provided is also proving to be useful in this regard.

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

Question asked: Mar 30 '12, 4:25 a.m.

Question was seen: 8,569 times

Last updated: Mar 30 '12, 4:25 a.m.

Confirmation Cancel Confirm