use of net.sourceforge.myvd.types.Password in project OpenUnison by TremoloSecurity.
the class MyVDConnection method bind.
public void bind(String dn, String password) throws LDAPException {
HashMap<Object, Object> request = new HashMap<Object, Object>();
HashMap<Object, Object> session = new HashMap<Object, Object>();
session.put(SessionVariables.BOUND_INTERCEPTORS, new ArrayList<String>());
session.put("MYVD_BINDDN", new DistinguishedName(""));
session.put("MYVD_BINDPASS", new Password());
BindInterceptorChain chain = new BindInterceptorChain(new DistinguishedName(""), new Password(), 0, core.getGlobalChain(), session, request, core.getRouter());
chain.nextBind(new DistinguishedName(dn), new Password(password), new LDAPConstraints());
}
use of net.sourceforge.myvd.types.Password in project OpenUnison by TremoloSecurity.
the class MyVDConnection method search.
public LDAPSearchResults search(String base, int scope, String filter, ArrayList<String> attributes) throws LDAPException {
HashMap<Object, Object> request = new HashMap<Object, Object>();
HashMap<Object, Object> session = new HashMap<Object, Object>();
session.put(SessionVariables.BOUND_INTERCEPTORS, new ArrayList<String>());
session.put("MYVD_BINDDN", new DistinguishedName("cn=TremoloAdmin"));
session.put("MYVD_BINDPASS", new Password());
ArrayList<net.sourceforge.myvd.types.Attribute> lattribs = new ArrayList<net.sourceforge.myvd.types.Attribute>();
Iterator<String> it = attributes.iterator();
while (it.hasNext()) {
lattribs.add(new net.sourceforge.myvd.types.Attribute(it.next()));
}
SearchInterceptorChain chain = new SearchInterceptorChain(new DistinguishedName("cn=TremoloAdmin"), new Password(), 0, core.getGlobalChain(), session, request, core.getRouter());
DistinguishedName baseDN = new DistinguishedName(base);
if (filter.contains("\\,")) {
filter = filter.replaceAll("[\\\\][,]", "\\\\5C,");
}
Filter searchFilter = new Filter(filter);
Results res = new Results(core.getGlobalChain(), 0);
chain.nextSearch(baseDN, new Int(scope), searchFilter, lattribs, new Bool(false), res, new LDAPSearchConstraints());
return new EntrySetSearchResults(res);
}
Aggregations