Commit 2682cf2b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

PLAIN SASL now accepts and validates bare JIDs as authcID. JM-962

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@7040 b35dd754-fafc-0310-a699-88a17e54d16e
parent 01d0b5a7
......@@ -456,6 +456,20 @@ public class SASLAuthentication {
tokens.nextToken();
}
username = tokens.nextToken();
if (username != null && username.contains("@")) {
// Check that the specified domain matches the server's domain
int index = username.indexOf("@");
String domain = username.substring(index + 1);
if (domain.equals(XMPPServer.getInstance().getServerInfo().getName())) {
// Domains match. Store in username just the username
username = username.substring(0, index);
}
else {
// Unknown domain. Return authentication failed
authenticationFailed(session);
return Status.failed;
}
}
password = tokens.nextToken();
try {
AuthToken token = AuthFactory.authenticate(username, password);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment