# HG changeset patch # User Da Risk # Date 1362601851 -3600 # Node ID 8198b5e53cac3c2c779f6dcfe4c1fa73f619ba26 # Parent 9496db83135d7a754215e988f21be91dafcf444b Scram-Sha-1 mechanism : do not send authzid if it not absolutely necessary Some servers (ejabberd) reject the challenge if the scram attributes a (authzid) and n (authcid) are equals or they just don't handle the authzid. So we just don't send it if they are the same This fix #484 diff -r 9496db83135d -r 8198b5e53cac src/com/beem/project/beem/smack/sasl/ScramSaslClient.java --- a/src/com/beem/project/beem/smack/sasl/ScramSaslClient.java Sat Mar 02 15:52:11 2013 +0100 +++ b/src/com/beem/project/beem/smack/sasl/ScramSaslClient.java Wed Mar 06 21:30:51 2013 +0100 @@ -106,6 +106,12 @@ String passwd = new String(passwdBytes); String nonce = getClientNonce(); clientAuthenticator = new SCRAMSHA1ClientAuthenticator(nonce); + // some servers (ejabberd) reject the challenge if the + // scram attributes a (authzid) and n (authcid) are equals + // or they just don't handle the authzid + // So we just don't send it if they are the same + if (authcid != null && authcid.equals(authzid)) + authzid = ""; clientAuthenticator.setCredentials(authcid, passwd, authzid); return clientAuthenticator.getResponse().getData(); }