Search code examples
tomcatencryptionauthenticationhawtio

Tomcat Hawtio encrypted password


I'm facing a problem to be able to login to an Hawtio console (inside a Tomcat container). I have a user "tomcat" with a encrypted password and "manager-gui" role (defined in tomcat-users file), which allows me to connect to the Tomcat Manager console:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager-gui"/>
  <user username="tomcat" password="encryptedPassword" roles="manager-gui"/>
</tomcat-users>

I configured Tomcat start by adding the following parameters to be able to connect as well to the Hawtio console:

-Dhawtio.authenticationEnabled=true
-Dhawtio.roles=manager-gui

But Hawtio does't care about Tomcat encrypt parameter inside "server.xml" file, so I can't login with the encrypt password (get "failed to login" message):

<Realm className="org.apache.catalina.realm.MemoryRealm" digest="SHA" />

If I use the encrypted value of the password to connect, it works (that proves Hawtio is not trying to decrypt the password).

Anyone to help me ?

Thanks :)

[EDIT] This feature has been added in the version 1.4.49 of Hawtio (ticket https://github.com/hawtio/hawtio/issues/1899)


Solution

  • This is not supported using the simple tomcat security plugin in hawtio. You are welcome to log a ticket [1] about this, then we can see if that would be possible for us to implement.

    Another alternative could be use JAAS in Tomcat as hawtio can work with that.

    [1] - https://github.com/hawtio/hawtio/issues