Fixed it!!
The problem was bits after the authentication throwing an exception, which was being misinterpreted as the authentication failing due to incorrect use of the try/catch block.
To solve this, check out the sources from subversion. In webchat/src/java/org/jivesoftware/webchat/actions/ChatStarter.java, apply the following patch:
Index: actions/ChatStarter.java
— actions/ChatStarter.java (revision 12013)
+++ actions/ChatStarter.java (working copy)
@@ -198,23 +198,33 @@
// authentication is required, all users must login
String username = (String)metadata.get(“username”);
String password = (String)metadata.get(“password”);
-
// load user metadata
-
properties = wGroup.getWorkgroupProperties(username + "@" + settings.getServerDomain());
-
metadata.put("name", properties.getFullName());
-
metadata.put("email", properties.getEmail());
-
chatSession.setEmailAddress(properties.getEmail());
-
metadata.remove("password");
-
chatloginok=true;
}
catch (Exception e) {
try {
-
WebLog.logError("Authentication failed - ", e);
response.sendRedirect("userinfo.jsp?authFailed=true&workgroup=" + workgroup);
}
catch (IOException redirectException) {
WebLog.logError("Error during redirection - ", redirectException);
}
}
-
// load user metadata
-
if (chatloginok) {
-
try {
-
properties = wGroup.getWorkgroupProperties(username + "@" + settings.getServerDomain());
-
metadata.put("name", properties.getFullName());
-
metadata.put("email", properties.getEmail());
-
chatSession.setEmailAddress(properties.getEmail());
-
metadata.remove("password");
-
}
-
catch (Exception e) {
-
WebLog.logError("Error setting up workgroup properties - ", e );
-
}
-
}
}
else {
for (int i = 0; i < 5; i++) {
@@ -330,4 +340,4 @@
}
-}
\ No newline at end of file
+}
After building and deploying the chat client with this patch, chat authentication works properly.
If the other bits fail, this will be logged (the actual cause), whereas an incorrect password will still yield “Authentication failed.” as before.