Smack login with md5 hashed password to Openfire

How can I login with MD5 hashed password to openfire?

I’m using smack 4.0.4.

I’ve tried DIGEST-MD5 registiration but it’s not work

SASLAuthentication.registerSASLMechanism("DIGEST-MD5", SASLDigestMD5Mechanism.class); SASLAuthentication.supportSASLMechanism("DIGEST-MD5");

I’m getting this error :

SASLError using PLAIN: not-authorized

My code looks like this:

config = new ConnectionConfiguration(xmppServerAddress, Integer.parseInt(xmppServerPort));

config.setDebuggerEnabled(true);

config.setReconnectionAllowed(true);

config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);

XMPPTCPConnection connectionTmp = new XMPPTCPConnection(config);

connectionTmp.connect(); 

connectionTmp.login("username","md5hashedpassword");

SASLAuthentication.registerSASLMechanism("DIGEST-MD5", SASLDigestMD5Mechanism.class); SASLAuthentication.supportSASLMechanism("DIGEST-MD5");
You don’t need to do that, DIGEST-MD5 is enabled per default in Smack.

Enable Smack debug by setting SmackConfiguration.DEBUG to true and show us the communication between Smack and the Server.

Sent packets:

<stream:stream to=“192.168.1.95” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” version=“1.0”>

ADEwAGQzZDk0NDY4MDJhNDQyNTk3NTVkMzhlNm QxNjNlODIw

Received Packets:

<?xml version='1.0' encoding='UTF-8'?>PLAINzlib

I can log in with a non hashed password.

PLAIN</mechanis ms>

The server does not announce support for DIGEST-MD5 (also the xml is malformed, but i guess it’s just a copy&paste error on your side).

Well, what should I do for Openfire?

I think it’s enabled also per default in openfire.