users@glassfish.java.net

Re: encoding problem in Basic Authentication

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Tue, 26 Jan 2010 07:50:25 +0100

when I return from Jfokus I will try again.. I am using the default
Basic Authentication, from GF servlet container....

it works on linux but fails on windows... I need to check better to
find this problem....

On Tue, Jan 26, 2010 at 12:55 AM, <Ronald.Monzillo_at_sun.com> wrote:
> On 01/23/10 13:35, Felipe Gaścho wrote:
>>
>> I have a Basic Authentication working fine on a Linux machine, but
>> doesn't in a windows machine... why ?
>>
>>
>
> Hi Felipe,
>
> Are you just using the Basic Authenticator of the Glassfish servlet
> container, (i.e.,
> just setting auth-method to BASIC in login-confiig) ..
>
> or are you doing something more sophisticated
> (perhaps such as defining and implementing your own Server Auth Module)?
>
> What is your setup, as in what type of machine is your web container running
> on,
> and what type of machine is trying to access it?
>
> what realm is configured for your web application?
>>
>> I suspect it is an encoding problem since the server working on
>> windows should receive the authentication values in Cp1252 while the
>> Linux one receive in UTF-8 ...
>>
>> where to start checking that ?
>>
>
> If you are using the BasicAuthenticator of the Glassfish Servlet container,
> and you setup a debugger
> with the Glassfish srcs, then the simplest thing to do, would probably be to
> set breakpoints
> in the  org.apache.catalina.authenticator.BasicAuthenticator; and see what
> values the server is receiving from
> the client. The username and password will be Base64 encoded, but the
> Authenticator, decodes the
> base64 encoding so you should be able to see the values that come in from
> the client.
>
> In support of your character set concern, note that the Authenticator
> use String.getBytes without specifying a target charset, to convert the
> String
> username and password values obtained from the Http Authorization header
> into
> a byte array for comparison to the values obtained from the realm.
>
> Ron
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>



-- 
------------------------------------------
   Felipe Gaścho
   10+ Java Programmer
   CEJUG Senior Advisor