users@jersey.java.net

[Jersey] Base64 encoding problem

From: Frederic Bergeron <FBergeron_at_rocketmail.com>
Date: Thu, 6 Oct 2011 05:05:48 -0700 (PDT)

Hi,

I have a strange bug and I'm wondering if anyone has an idea about it.

I'm using a Jersey client (via an instance of fedora-client) to interoperate with a RESTful server.  However, for some reason, the client cannot authenticate itself successfully.  Using an HTTP monitor, I can see the problem.  The base64-encoded credentials data sent by the client is incorrect.  The expected base64-encoded string is:

ZmVkb3JhQWRtaW46ZmVkb3JhQWRtaW4=

but the client sends rather

ZmVkb3JhQWRtaW46ZmVkb3JhQWRtaW4A

The username and password that I use are both fedoraAdmin, i.e., the base64-encoded string is "fedoraAdmin:fedoraAdmin" (without the quotes).

I've tried to make a simple example to isolate the bug but I'm unable to reproduce it :-( 

Any idea of what could cause the problem?

Frederic Bergeron