title: How to use digest authentication in Tomcat 8.5?
body: <p>I am trying to use the manager application that comes with Tomcat 8.5. However, every time that I try to log on with the password of "test" for the user "admin", it does not work.  If I plug in the exact MD5 hash that I obtained from digest.bat, I am able to log in.</p>
  
  <p>Has anyone managed to get this working appropriately?</p>
  
  <p><strong>server.xml</strong></p>
  
  <pre><code>&lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                 resourceName="UserDatabase" digest="md5" /&gt;
                &lt;CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="MD5" /&gt;
          &lt;/Realm&gt;
  </code></pre>
  
  <p><strong>tomcat-users.xml</strong></p>
  
  <pre><code>&lt;?xml version='1.0' encoding='cp1252'?&gt;
  &lt;!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  --&gt;
  &lt;tomcat-users xmlns="http://tomcat.apache.org/xml"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
                version="1.0"&gt;
  
  &lt;user username="admin" password="41858d1250c84a1bfb882bcb02b85ba8" roles="admin-gui,manager-gui" /&gt;
  &lt;user username="test" password="test" roles="manager-gui,admin-gui" /&gt;
  &lt;/tomcat-users&gt;
  </code></pre>
  
  <p><strong>tomcat webapp manager web.xml excerpt</strong></p>
  
  <pre><code>  &lt;!-- Define the Login Configuration for this Application --&gt;
    &lt;login-config&gt;
      &lt;auth-method&gt;DIGEST&lt;/auth-method&gt;
      &lt;realm-name&gt;TEST&lt;/realm-name&gt;
      &lt;!--&lt;realm-name&gt;Tomcat Manager Application&lt;/realm-name&gt;--&gt;
    &lt;/login-config&gt;
  </code></pre>
  
  <p><strong>digest.bat output</strong></p>
  
  <pre><code>.\digest.bat -a MD5 -s 0 admin:TEST:test
  admin:TEST:test:41858d1250c84a1bfb882bcb02b85ba8
  </code></pre>