Package com.novell.ldap

Examples of com.novell.ldap.LDAPConnection.connect()


        // Connect to LDAP server
        LDAPConnection ldapConnection;
        try {

            ldapConnection = new LDAPConnection();
            ldapConnection.connect(
                    GuacamoleProperties.getRequiredProperty(LDAPGuacamoleProperties.LDAP_HOSTNAME),
                    GuacamoleProperties.getRequiredProperty(LDAPGuacamoleProperties.LDAP_PORT)
            );

        }
View Full Code Here


  public static User authenticate(String user, String password){

    LDAPConnection connection = new LDAPConnection();
    try {
      // Se establece la conexion con el servidor LDAP
      connection.connect(config.getString(IP), new Integer(config.getString(PORT)));
     
      // Se autentica el usuario
      byte[] encryptPassword = password.getBytes(UTF8);
      connection.bind(LDAPConnection.LDAP_V3, config.getString(DOMAIN)+ DOUBLE_BAR + user, encryptPassword);
     
View Full Code Here

    Set<LDAPGroup> groups = new HashSet<LDAPGroup>();
   
    LDAPConnection connection = new LDAPConnection();
    try {
      // Se establece la conexion con el servidor LDAP
      connection.connect(config.getString(IP), new Integer(config.getString(PORT)));
     
      // Se autentica el usuario
      connection.bind(LDAPConnection.LDAP_V3, config.getString(DOMAIN)+ DOUBLE_BAR + user, password);
     
      LDAPSearchResults ldapSearchResults = connection.search("CN=Users,DC=" + config.getString(DOMAIN)+ ",DC=local",
View Full Code Here

    Collection<User> users = new ArrayList<User>();
   
    LDAPConnection connection = new LDAPConnection();
    try {
      // Se establece la conexion con el servidor LDAP
      connection.connect(config.getString(IP), new Integer(config.getString(PORT)));
     
      // Se autentica el usuario
      connection.bind(LDAPConnection.LDAP_V3, config.getString(DOMAIN)+ DOUBLE_BAR + user, password);
     
      LDAPSearchResults ldapSearchResults = connection.search("CN=Users,DC=" + config.getString(DOMAIN)+ ",DC=local", LDAPConnection.SCOPE_SUB, "(&(objectCategory=person)(objectClass=user))", null, Boolean.FALSE);
View Full Code Here

    Collection<User> users = new ArrayList<User>();
   
    LDAPConnection connection = new LDAPConnection();
    try {
      // Se establece la conexion con el servidor LDAP
      connection.connect(config.getString(IP), new Integer(config.getString(PORT)));
     
      // Se autentica el usuario
      connection.bind(LDAPConnection.LDAP_V3, config.getString(DOMAIN)+ DOUBLE_BAR + user, password);
     
      LDAPSearchResults ldapSearchResults = connection.search("CN=Users,DC=" + config.getString(DOMAIN)+ ",DC=local", LDAPConnection.SCOPE_SUB, "(&(objectCategory=person)(objectClass=user))", null, Boolean.FALSE);
View Full Code Here

        ldapPort = LDAPConnection.DEFAULT_PORT;  // Port 389
      }
    }
    try {
      // connect to the server
      lc.connect(serverAddress, ldapPort);
      // authenticate to the server
      lc.bind(LDAPConnection.LDAP_V3, connectionDN, connectionPassword.getBytes());
    } catch (LDAPException e) {
      log.error("Error during AD bind", e);
      disconnect(lc);
View Full Code Here

        do {
          connectionFailed = false;
          String currentServer = (String) servers.next();
          try {
            TCPTool.probeConnectionLDAP(currentServer, Integer.parseInt(getPort()), getConnectionTimeOut())// Avoid waiting for halfdead-servers
            lc.connect(currentServer, Integer.parseInt(getPort()));
            // authenticate to the server
            lc.bind(ldapVersion, getLoginDN(), getLoginPassword().getBytes("UTF8"), ldapBindConstraints);           
            // Add or modify the entry
            if (oldEntry != null && getModifyExistingUsers()) {
              LDAPModification[] mods = new LDAPModification[modSet.size()];
View Full Code Here

      connectionFailed = false;
      String currentServer = (String) servers.next();
      try {
        TCPTool.probeConnectionLDAP(currentServer, Integer.parseInt(getPort()), getConnectionTimeOut())// Avoid waiting for halfdead-servers
        // connect to the server
        lc.connect(currentServer, Integer.parseInt(getPort()));
        // authenticate to the server
        lc.bind(ldapVersion, getLoginDN(), getLoginPassword().getBytes("UTF8"), ldapBindConstraints);
        // Add or modify the entry
        if (oldEntry != null) {
          LDAPModification[] mods = new LDAPModification[modSet.size()];
View Full Code Here

      if (log.isDebugEnabled()) {
        log.debug("currentServer: "+currentServer);
      }
      try {
        TCPTool.probeConnectionLDAP(currentServer, Integer.parseInt(getPort()), getConnectionTimeOut())// Avoid waiting for halfdead-servers
        lc.connect(currentServer, Integer.parseInt(getPort()));
        // authenticate to the server
        lc.bind(ldapVersion, getLoginDN(), getLoginPassword().getBytes("UTF8"), ldapBindConstraints);           
        // Add or modify the entry
        if (oldEntry != null && modSet != null && getModifyExistingUsers()) {
          if (removecert) {
View Full Code Here

      String currentServer = (String) servers.next();
      LDAPEntry entry = null;
      try {
        TCPTool.probeConnectionLDAP(currentServer, Integer.parseInt(getPort()), getConnectionTimeOut())// Avoid waiting for halfdead-servers
        // connect to the server
        lc.connect(currentServer, Integer.parseInt(getPort()));
        // authenticate to the server
        lc.bind(ldapVersion, getLoginDN(), getLoginPassword().getBytes("UTF8"), ldapBindConstraints);
        // try to read the base object
        String baseDN = getBaseDN();
        if (log.isDebugEnabled()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.