michelangelo13 / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

Ignore HTTP request parameters that are arrays longer than 1 #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm implementing OpenID authentication support for an application that uses
the Zk AJAX framework (www.zkoss.org). The Zk creates some request
parameters on the fly (due to it's AJAX nature and its internal working
logic). Some of those request parameters are arrays, which length is bigger
than one. It looks like OpenID4Java don't like that, throwing an
IllegalArgument exception.

The code extract responsable for that is the following, from
org/openid4java/message/ParameterList.java:

if (v instanceof Object[])
{
  Object[] values = (Object[]) v;
  if (values.length > 1)
   throw new IllegalArgumentException(
     "Multiple parameters with the same name: " + values);
   value = values.length > 0 ? (String) values[0] : null;
}

It wouldn't be better to just _ignore_ array objects which length is bigger
than 1, instead of throwing an exception? I created a patch following this
rationale. I tested it with my application, and, so far, so good.

Original issue reported on code.google.com by magsi...@gmail.com on 30 May 2007 at 7:46

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, the first patch I sent was wrong (syntatic errors, it won't compile). I
attached a newer patch to fix that.

Original comment by magsi...@gmail.com on 30 May 2007 at 8:04

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry for the late reply. openid.* fields MUST NOT have multiple values -- 
that's 
why the check was there.

We haven't accounted for pass-through parameters (a topic not covered in the 
spec), 
but they should probably be allowed to have multiple values.

Rev 275 addresses this.

Thanks!
Johnny

Original comment by Johnny.B...@gmail.com on 10 Jul 2007 at 7:40

GoogleCodeExporter commented 9 years ago

Original comment by Johnny.B...@gmail.com on 10 Jul 2007 at 7:40