mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +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:
parent
13d87e3d40
commit
fe2e9cdb76
2 changed files with 99 additions and 13 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue