title: How to use hashed passwords with BASIC authentication in tomcat6?
body: <p>I want to use hashed passwords in tomcat-users.xml with BASIC authentication. I added digest="SHA" to realm definition. UserDatabase part is defined as this in $TOMCAT_HOME/conf/server.xml:</p>
  
  <pre><code>&lt;GlobalNamingResources&gt;
  &lt;Resource name="UserDatabase" auth="Container"
            type="org.apache.catalina.UserDatabase"
            description="User database that can be updated and saved"
            factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
            pathname="conf/tomcat-users.xml" /&gt;
  &lt;/GlobalNamingResources&gt;
  ...
  &lt;Engine&gt;
  ...
        &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               digest="SHA"
               resourceName="UserDatabase" /&gt;  
  ...
  &lt;/Engine&gt;
  </code></pre>
  
  <p>But after restart tomcat still treats all defined in $TOMCAT_HOME/conf/tomcat-users.xml passwords as plain-text ones.</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;tomcat-users&gt;
  &lt;user username="guest" password="e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4" roles="role1" /&gt;
  &lt;/tomcat-users&gt;
  </code></pre>
  
  <p>I.e. I can login with username/password guest/e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4, but not with guest/secret as it should be.</p>
  
  <p>Please point me what I'm doing wrong?</p>