tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Molloy" <mollo...@eeng.dcu.ie>
Subject Automatically Generating htpasswd files
Date Tue, 30 Oct 2001 15:33:43 GMT
Hi,
   I'm using Tomcat4.0, Apache 1.3 both as standalone and I'm
working on a University project which uses both.  Currently I'm
stuck on the problem of generating htpasswd files using a servlet.
Does anyone know what should be used to generate up files of
the form :

smithy:HDECzKIIDIiu2
jonesp:ZYTSVZ22bx3Ng

I tried using the following code:

sun.misc.BASE64Encoder enCoder = new sun.misc.BASE64Encoder();
aWriter.write(tempUser.getUsername() + ":" +
enCoder.encode(tempUser.getPassword().getBytes()) + "\n");

but it doesn't seem to be working right - I'm not even sure if
this is exactly what's needed - any ideas please?

Dave


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message