It's all about the answers!

Ask a question

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

Marianna Budnikova (26113) | asked Jul 03 '13, 10:15 a.m.

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 (Build 214).

Any help or comments are greatly appreciated!


Accepted answer

permanent link
Gabriel Ruelas (1.1k13) | answered Jul 03 '13, 1:26 p.m.
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

Marianna Budnikova commented Jul 03 '13, 1:39 p.m. | edited Jul 03 '13, 1:40 p.m.

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! 

Marianna Budnikova commented Aug 15 '13, 1:15 p.m.

Sorry for a late update, but I changed the code of 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());

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

Marianna Budnikova commented Aug 15 '13, 1:15 p.m.

 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");

2 other answers

permanent link
Gabriel Ruelas (1.1k13) | answered Jul 03 '13, 12:50 p.m.
Have you checked the in package org.eclipse.lyo.client.oslc.samples ? That sample works fine for latest versions of Doors.

Marianna Budnikova commented Jul 03 '13, 1:06 p.m.

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

permanent link
itay ariel (1133) | answered Jul 04 '13, 6:57 a.m.
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

Your answer

Register or 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.