Thks for your response !


But I have now another pb .

javadoc for org.apache.catalina.realm.RealmBase.Digest() says :
... Digest password using the algorithm especificied and convert the result to a corresponding hex string ...


So how to convert my base64(MD5()) digest to the correct hex String ?
I try Integer.toHexString on each byte ... no good.

MD5 digest for realm auth don't seem to be a simple MD5 digest ..

At 06:42 2003-08-07 -0400, you wrote:
My favorite Base64 library is org.apache.catalina.util.Base64 ;)

-Tim

Bill Barker wrote:
I agree with Nikola. Firstly, even if you could access Catalina internals,
you are calling the wrong method.  You would need to call getDigest(String
userName, String Pass).  From the RealmBase code, you probably want
something like:
<%
  MessageDigest md = MessageDigest.getInstance("MD5");
  String preDigest = request.getParameter("user")+
":"+RealmName+request.getParameter("password");
  byte [] pwd = md.digest(preDigest.getBytes());
  String digest = toBase64(pwd);
%>
Here, toBase64 is your favorite byte->base64 encoding library.


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


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



Reply via email to