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

How to get the request token during OAuth dance when invoking OSLC from DOORS with Lyo Eclipse?

Hi! 

I am trying to invoke an OSLC service from DOORS with Lyo Eclipse SDK, and I am having a problem with OAuth dance. 

When I am trying to get the response token, I receive a HTTP 401 Unauthorized (Invalid signature for signature method HMAC-SHA1). Here is the GET HTTP being sent:

GET /dwa/oauth-request-token?oauth_consumer_key=ed69becd-cff7-4971-8968-cd4365d31fc6&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1372858221&oauth_nonce=91641252155718&oauth_version=1.0&oauth_signature=tneemmQNiDo8HN+l4gqjkkmwtv8=

I am using DOORS Web Access 1.5.0.0 (Build 214).

Any help or comments are greatly appreciated!

Thanks,
Marianna

1 vote


Accepted answer

Permanent link
Which Doors version are you using ( not DWA version )  ?

Also, I have a a version of that sample that works with previous versions of doors ( I think 9.4 ) ? I could send you via email if needed.
Marianna Budnikova selected this answer as the correct answer

0 votes

Comments

Just checked, I have the version 9.4. Will you please send me the sample that works with this version to marianchik<at>list<dot>ru ? Thank you! 

Sorry for a late update, but I changed the code of DoorsOauthSample.java to an older version, and I was able to login. Apparently, DOOR 9.4 does not work with the new version of DOORS sample in Lyo. I changed in function validateTokens by replacing the following code:


HttpPost formPost2 = new HttpPost(location.getValue());
formPost2.addHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");

HttpParams params = new BasicHttpParams();
params.setParameter("oauth_token", oauthToken);
params.setParameter("oauth_verifier", oauthverifier);
params.setParameter("authorize", "true");
formPost2.setParams(params);

 with this code:


HttpPost formPost2 = new HttpPost(authURL);
formPost2.getParams().setParameter("oauth_token", oauthToken);
formPost2.getParams().setParameter("oauth_verifier", oauthverifier);
formPost2.getParams().setParameter("authorize", "true");
formPost2.addHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");


2 other answers

Permanent link
Have you checked the DoorsOauthSample.java in package org.eclipse.lyo.client.oslc.samples ? That sample works fine for latest versions of Doors.

0 votes

Comments

 Gabriel, I tried running the sample you suggested, and it gets the same HTTP 401 error.


Permanent link
I think you need to UrlEncode the oauth_signature, (checked with my version)
also maybe thats because of the accept header, but I am not sure

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
× 10,937
× 7,495
× 516
× 198
× 35

Question asked: Jul 03 '13, 10:15 a.m.

Question was seen: 8,246 times

Last updated: Aug 15 '13, 1:15 p.m.

Confirmation Cancel Confirm