Ok, here is the JBoss authentication provider. It’'s simple. One may provide jbossauth.securitydomain property inside jive-messenger.xml. Otherwise it defaults to “other”.
package org.jivesoftware.messenger.auth;
import java.security.Principal;
public class JBossProvider implements AuthProvider {
protected String securityDomain = null;
public JBossProvider() {
this.securityDomain = JiveGlobals.getXMLProperty(“jbossauth.securitydomain”);
if (null == this.securityDomain)
this.securityDomain = “other”;
}
public boolean isPlainSupported() {
return true;
}
public boolean isDigestSupported() {
return false;
}
public void authenticate(String nick, String pass)
throws UnauthorizedException {
Principal p = new SimplePrincipal(nick);
CallbackHandler handler =
new org.jboss.security.auth.callback.SecurityAssociationHandler(p, pass.toCharArray());
try {
LoginContext lc = new LoginContext(securityDomain, handler);
lc.login();
} catch (LoginException e) {
throw new UnauthorizedException();
}
}
public void authenticate(String username, String token, String digest)
throws UnauthorizedException {
// FIXME: Somebody will do it in the future.
throw new UnauthorizedException(
“Digest authentication is not implemented yet.”);
}
}
It seems this module is not sufficient to login to admin console. I have added a username which is ok for jboss login-module also added to authorizedUsernames inside jive-messenger.xml but refuses to login.
Any ideas? I’‘ll continue tomorrow i’'m very tired.
Have a nice day.