Shibboleth, Tomcat, AJP and UTF-8 conversion

Mark Juszczec mark.juszczec at gmail.com
Thu Oct 20 10:06:26 EDT 2016


On Thu, Oct 20, 2016 at 9:56 AM, Cantor, Scott <cantor.2 at osu.edu> wrote:

>
> I see nothing there indicating the SP is doing anything wrong, which is
> why nothing's been done to the code. I can't change what Tomcat does with
> the data its given. If it's assuming an encoding that's not correct, then
> it's going to break things, but that would be true of real headers from the
> client too.
>
>
I'm not suggesting this is a bug in Shibboleth.

It seems to me, its more like Tomcat is following the spec and its having
this unpleasant side effect in a certain Shibboleth use case.

Basically, my data is UTF-8.  When I step thru the Tomcat code, Tomcat's
ByteChunk coverts it to ISO-8859-1

Nothing I've tried to override this has had any effect.



> > Is the solution appropriate for data delivered as attributes?
>
> No idea but whatever that's doing isn't about where the data is actually
> being pulled from.
>
>
The solution comes from the second link.  I see it posted it incorrectly
added a correction just before I got your reply.

The correct url is https://wiki.shibboleth.net/confluence/display/SHIB2/
NativeSPAttributeAccess and in the Java link it says use:

String value= request.getHeader("givenName");
value= new String( value.getBytes("ISO-8859-1"), "UTF-8");


In my case I'll have to use request.getAttribute("givenName"); because
my data is delivered via attributes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20161020/0bbda808/attachment.html>


More information about the users mailing list