Skip to content

Commit 82b106d

Browse files
author
Eric Mears
committed
merging 1.1.0
2 parents 7791796 + 9627145 commit 82b106d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<groupId>org.directtruststandards</groupId>
1111
<artifactId>timplus-server-core</artifactId>
12-
<version>1.0.0</version>
12+
<version>1.1.0</version>
1313
<name>TIM+ Core XMPP Server</name>
1414

1515
<properties>

src/main/java/org/jivesoftware/openfire/net/XMPPCallbackHandler.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.jivesoftware.openfire.auth.AuthorizationManager;
3333
import org.jivesoftware.openfire.sasl.VerifyPasswordCallback;
3434
import org.jivesoftware.openfire.user.UserNotFoundException;
35+
import org.jivesoftware.util.JiveGlobals;
3536
import org.slf4j.Logger;
3637
import org.slf4j.LoggerFactory;
3738

@@ -117,6 +118,13 @@ else if (callback instanceof AuthorizeCallback) {
117118
//Log.debug("XMPPCallbackHandler: no username requested, using " + username);
118119
}
119120
}
121+
/*
122+
clients like pidgin, pass in the username, not the barejid, so the db query for the user fails.
123+
When timplus.allowLoginWithoutBareJID is set, we pass in the barejid (user@domain), so the query will work.
124+
*/
125+
if( Boolean.parseBoolean(JiveGlobals.getProperty("timplus.allowLoginWithoutBareJID"))) {
126+
username = principal;
127+
}
120128
if (AuthorizationManager.authorize(username, principal)) {
121129
if (Log.isDebugEnabled()) {
122130
//Log.debug("XMPPCallbackHandler: " + principal + " authorized to " + username);

src/main/java/org/jivesoftware/openfire/sasl/SaslServerPlainImpl.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import javax.security.sasl.SaslServer;
2626

2727
import org.jivesoftware.openfire.session.LocalSession;
28+
import org.jivesoftware.util.JiveGlobals;
2829

2930
import javax.security.sasl.SaslException;
3031
import javax.security.sasl.AuthorizeCallback;
@@ -117,7 +118,14 @@ public byte[] evaluateResponse(byte[] response)
117118
}
118119
if (localSession != null)
119120
username += "@" + localSession.getServerName();
120-
121+
122+
/*
123+
clients like pidgin, pass in the username, not the barejid, so the db query for the user fails.
124+
When timplus.allowLoginWithoutBareJID is set, we pass in the barejid (user@domain), so the query will work.
125+
*/
126+
if( Boolean.parseBoolean(JiveGlobals.getProperty("timplus.allowLoginWithoutBareJID"))) {
127+
principal = username;
128+
}
121129
password = tokens.nextToken();
122130
NameCallback ncb = new NameCallback("PLAIN authentication ID: ",principal);
123131
VerifyPasswordCallback vpcb = new VerifyPasswordCallback(password.toCharArray());

0 commit comments

Comments
 (0)