Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] DoorsOauthSample


On Wed, Jun 26, 2013 at 12:10 PM, Peter Raymond <praymond@xxxxxxxxxx> wrote:

Hi,

 

I have been struggling to get the sample OSLC client for DOORS to work for some time.  I think I have found several defects in the code and believe I have fixes for them.  Just wondering if anyone else got this sample to run or if maybe it is dependent on version of DOORS or some other environment or configuration difference or if this sample has not been tested.

 

The code I am trying to get running is the DoorsOauthSample.java in the package org.eclipse.lyo.client.oslc.samples.

I am using IBM DOORS 9.4 with Doors Web Access 1.5.

I am working with the latest code for the org.eclipse.lyo.client (cloned from the master branch at git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.client.git)

 

So far the problems I have found and fixed locally are:

 

1)      On line 419 in the validateTokens method the code tries to get the oauth_token and oauth_verifier query params from a URL.  But it is looking at the wrong URL, it tries to get the parameters from the URL that it sent the third GET request to…it should be looking at the URL that the third GET returned (the location sent in the 302 response to the third GET).

 

2)      There is a method called getQueryMap which tries to build a Map of name/value pairs based on the query parameters from a URL that is passed into the method.  But it will never pick up the very first query parameter correctly from the URL because it splits using ‘&’ character.  Let’s say the method is passed http://myhost/something?a=1&b=2  the map returned will contain key “http://myhost/something?a” with value “1” and another entry in the map where key is “b” and value is “2”.  

 

3)      On line 424 in the validateTokens method the POST request is being sent to the wrong URL.  It uses the variable authUrl which is still pointing to the login form.  It should instead use the URL that was returned from the third GET.

 

4)      On line 425 the code tries to set some parameters into the body of the POST request but it is doing this BEFORE setting the content type so those parameters never get set.

 

Having made those changes the sample successfully logs in to DOORS and obtains the OSLC catalogue.  But now I am running into troubles navigating the catalogues and providers to find the provider for my DOORS project.  So I suspect there are further fixes needed to the code but before I spend much more time on it was wondering if anyone has hit the same problems with the sample?

 

I have attached a patch of my modifications so far.  Should I raise a bugzilla ticket for this and get my patch submitted?

 

Hi Peter,

I think it would be best if you did that, there are instructions here to help guide you: http://wiki.eclipse.org/Lyo/ContributorsGettingStarted#Lyo_contribution_process

Let us know you get stuck and thanks for sharing this.

 - Steve Speicher

Regards,

--

Peter Raymond

Principal Software Architect

Serena Software

mailto: praymond@xxxxxxxxxx

WWW: http://www.serena.com

 


_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/lyo-dev



Back to the top