return ar.getADAttributes((ADIdentity)identity,username,password);
}
public static String testAuthenticate(Config config, String username, String password) {
ADRealm ar = new ADRealm();
//Principal p = ar.authenticate(username,password);
MailArchivaPrincipal cgp = null;
try {
cgp = (MailArchivaPrincipal)ar.authenticate(config,username,password);
if (cgp!=null) {
String roleName = cgp.getRole();
return "Authentication success. Role "+roleName+" is assigned.";
} else
return "Authentication failed.";