Deemoore / oauth-signpost

Automatically exported from code.google.com/p/oauth-signpost
0 stars 0 forks source link

signpost-core-1.2 does not work when two parameters with the same name are supplied. #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the attached file after substituting your API consumer key and
secret for LinkedIn.
2. The example is taken from the linked in forums and the majority of
LinkedIn API work with signpost-core-1.2 except for the one mentioned in
the example.
3. As far as I can guess, when you supply two parameters with the same name
(type parameter in this example), the signpost library throws 401
unauthorized error.

What is the expected output? What do you see instead?
I should get 200 response with a list of all the network updates. Instead I
get a 401 response with the error message. I have also tried
consumer.setCompatibilityModeForEmptyTokens(true); to no avail.

What version of the product are you using? On what operating system?
I am using signpost-core-1.2.jar. It was working correctly on a snapshot
version signpost-core-1.1-SNAPSHOT.jar.

Please provide any additional information below.
You can get the API key from linked in from the url:
https://www.linkedin.com/secure/developer

Also see http://developer.linkedin.com/index.jspa for details about
LinkedIn OAuth.

Original issue reported on code.google.com by nabeelmukhtar on 2 Feb 2010 at 6:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Forgot to mention that I am using commons-codec-1.3.jar with java version 
1.6.0_03 on
windows.
Also note that if you delete the second type parameter from the url, the example
works ok.
The file is attached. 

Original comment by nabeelmukhtar on 2 Feb 2010 at 6:21

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting. Hm, I'm fairly sure I had a test case for that. I'll look 
into it. I 
wanted to prepare a 1.2.1 maintenance release anyway, but I'm pretty busy ATM 
so it 
could take a couple weeks.

Original comment by m.kaepp...@gmail.com on 3 Feb 2010 at 1:02

GoogleCodeExporter commented 9 years ago
I just came across this issue. The problem is in the decodeForm() method in the 
OAuth
class. Multi-valued parameters are processed one by one and they get placed in 
map.
As a result all but the last value of the multi-valued parameter goes in the 
map.

Original comment by andreas....@gmail.com on 9 Mar 2010 at 7:39

GoogleCodeExporter commented 9 years ago
Yes, I already started looking into this. I will probably have to change the 
API to
fix this.

Original comment by m.kaepp...@gmail.com on 9 Mar 2010 at 8:43

GoogleCodeExporter commented 9 years ago
Hey guys,

sorry for the delay, but I have a lot around my head ATM, and unfortunately I 
had to 
touch a lot of code to tackle this problem... I've attached a snapshot build, 
which is 
supposed to fix this problem. Can you please test it and tell me if it works 
for you?

Original comment by m.kaepp...@gmail.com on 11 Mar 2010 at 9:47

Attachments:

GoogleCodeExporter commented 9 years ago
I have run a few tests on signpost-core-1.2.1-SNAPSHOT.jar and it seems to work 
for me.

Thanks for your help.

Nabeel Mukhtar

Original comment by nabeelmukhtar on 12 Mar 2010 at 5:46

GoogleCodeExporter commented 9 years ago
I have also tested it with a scenario that uses a multi-valued parameter and it 
works.

Thank you,
Andreas

Original comment by andreas....@gmail.com on 12 Mar 2010 at 6:20

GoogleCodeExporter commented 9 years ago
great, thanks. I'll use my 10% time at work to work on Signpost all day today, 
and
hopefully get the 1.2.1 maintenance release out soon after.

Original comment by m.kaepp...@gmail.com on 12 Mar 2010 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by m.kaepp...@gmail.com on 14 Mar 2010 at 10:06