use of io.kamax.mxisd.backend.ldap.LdapAuthProvider in project mxisd by kamax-io.
the class LdapAuthTest method multiDNs.
@Test
public void multiDNs() {
MatrixConfig mxCfg = new MatrixConfig();
mxCfg.setDomain(domain);
mxCfg.build();
LdapConfig cfg = new GenericLdapConfig();
cfg.getConnection().setHost(host);
cfg.getConnection().setPort(65001);
cfg.getConnection().setBaseDNs(dnList);
cfg.getConnection().setBindDn(mxisdCn);
cfg.getConnection().setBindPassword(mxisdPw);
LdapConfig.UID uid = new LdapConfig.UID();
uid.setType(idType);
uid.setValue(idAttribute);
cfg.getAttribute().setUid(uid);
cfg.build();
LdapAuthProvider p = new LdapAuthProvider(cfg, mxCfg);
BackendAuthResult result = p.authenticate(MatrixID.from(userId, domain).valid(), userPw);
assertFalse(result.isSuccess());
}
use of io.kamax.mxisd.backend.ldap.LdapAuthProvider in project mxisd by kamax-io.
the class LdapAuthTest method singleDn.
@Test
public void singleDn() {
LdapConfig cfg = new GenericLdapConfig();
cfg.getConnection().setHost(host);
cfg.getConnection().setPort(65001);
cfg.getConnection().setBaseDn(dnList.get(0));
cfg.getConnection().setBindDn(mxisdCn);
cfg.getConnection().setBindPassword(mxisdPw);
cfg.build();
LdapConfig.UID uid = new LdapConfig.UID();
uid.setType(idType);
uid.setValue(idAttribute);
cfg.getAttribute().setUid(uid);
MatrixConfig mxCfg = new MatrixConfig();
mxCfg.setDomain(domain);
mxCfg.build();
LdapAuthProvider p = new LdapAuthProvider(cfg, mxCfg);
BackendAuthResult result = p.authenticate(MatrixID.from(userId, domain).valid(), userPw);
assertFalse(result.isSuccess());
}
Aggregations