Hi Andrew,

there's the class org.apache.util.Base64

to encode from user input to encoded:

    Base64 base64 = new Base64();
    String base64Encoded = new String(base64.encode(userPass.getBytes()));

What you want is to decode. I suppose method decode would do.

Regards,
Andreas



On 27 Nov 2002 at 6:43, ContestAdmin wrote:

> Andrew Guts wrote:
> 
> > Hi all,
> >
> > I am porting an old CGI application to JSP/servlets. I need to
> > port user authentication code also. But
> > getHeader("authorization") returns encoded string like "Basic
> > YW5kcmV3Og==". How to get original value like USER:PASSWORD ?
> >
> > Thanks ahead
> >
> > Andrew
> >
> > --
> > To unsubscribe, e-mail:  
> > <mailto:[EMAIL PROTECTED]> For
> > additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> 
> Hmm...
> 
> If I remember right (and I probably don't ;-) this information is
> encoded in Base64. All you need to do is run the 'YW5kcmV3Og=='
> stuff through a decoder.
> 
> -CA
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]> For
> additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to