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
--- 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();
}