1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

SMACK-344 Patch applied that allows the host and service name to be different for SASL authentication

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13620 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2013-04-20 22:05:28 +00:00
parent 13d87e3d40
commit fe2e9cdb76
2 changed files with 99 additions and 13 deletions

View file

@ -315,8 +315,13 @@ public class SASLAuthentication implements UserAuthentication {
currentMechanism = constructor.newInstance(this);
// Trigger SASL authentication with the selected mechanism. We use
// connection.getHost() since GSAPI requires the FQDN of the server, which
// may not match the XMPP domain.
currentMechanism.authenticate(username, connection.getServiceName(), password);
// may not match the XMPP domain.
//The serviceName is basically the value that XMPP server sends to the client as being the location
//of the XMPP service we are trying to connect to. This should have the format: host [ "/" serv-name ]
//as per RFC-2831 guidelines
String serviceName = connection.getServiceName();
currentMechanism.authenticate(username, connection.getHost(), serviceName, password);
// Wait until SASL negotiation finishes
synchronized (this) {
@ -383,7 +388,7 @@ public class SASLAuthentication implements UserAuthentication {
public String authenticateAnonymously() throws XMPPException {
try {
currentMechanism = new SASLAnonymous(this);
currentMechanism.authenticate(null,null,"");
currentMechanism.authenticate(null,null,null,"");
// Wait until SASL negotiation finishes
synchronized (this) {