SASLError using DIGEST-MD5: not-authorized on Smack 4.1

I have a project about chat app in school and I’ve already searched alot on stackoverflow and in this forum, but I couldn’t find the solution.

Here is my code:

What I did try:

  1. Login with just name (not include domain)

  2. Set Service using domain (failed connection)

3.Try to set SASLMechanism but there is not method SASLAuthentication.supportSASLMechanism(“PLAIN”,0); in smack 4.1

  1. Try to use openfire 3.10 beta ( failed can not login with other app such as : XABBER…)

5.Password to login is correct (100% sure)

Please help me because the deadline for this project is due soon. The document for 4.1 is wrong, out-of-date, take me alot of time to fix the error. Do you have any example to learn Smack ?


What’s your XMPP domain (i.e. the XMPP service name)?

I use openfire 3.9.3. It’s set by default : ADMIN-PC. When I try to setServiceName(“ADMIN-PC”), I got connection failed, I think because I use genymotion emulator and it uses different IP address, so emulator cannot know what is ADMIN-PC. I’ve already installed XABBER on emulator and I have to use IP address as domain to connect to openfire.

Use the configuration builders setHostnameAndPort to specify a host and port to use as XMPP service.

Thank Flow,

The correct way to set is : setService (“myservice”);