Connect error: SASL Authentication failed. No known authentication mechanisims

When trying to write my first XMPP client using Smack (4.1.0-beta1) (running against OpenFire 3.9.3) i keep getting the following error:

org.jivesoftware.smack.SmackException: SASL Authentication failed. No known authentication mechanisims

I tried all kinds of username/password settings but no luck so far. When connecting with Pidgin the connection seems ok.

Any clue what i am missing?

I also tried all possible scenario’s for the servicename and host…

XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()

.setUsernameAndPassword(“admin”, “admin”)






    XMPPTCPConnection connection = new XMPPTCPConnection(config);

    try {


connection.login(); // fails!!!


} catch (SmackException e) {


} catch (IOException e) {

e.printStackTrace(); } catch (XMPPException e) {



Please follow the instructions found in sue.

The solution to this problem is to add the correct dependencies. Using Gradle i added the following dependencies.





The Smack 4.1 Readme basically tells you that you either want smack-android or smack-java7, then you don’t need to add smack-sasl-* and some more stuff will be done for you depending on the target platform.

Thanks very much for pointing me out! I missed this one completely!


I’m using Smack 4.1.0 and I have the same problem; I read your posts but I don’t understand how to you solved the problem. Please can you explain me?

You only need to include the smack-java7 dependencies. This includes all other dependencies.

Maven example…




Smack 4.1 Readme and Upgrade Guide · igniterealtime/Smack Wiki · GitHub

Hope this helps

Can you advise what needs to be done for Gradle?