code: @Override
      public boolean setUserAsUser(Node node, String uid, String password) throws Exception {
  		boolean status = false;
  		StringBuilder sb = new StringBuilder(userIdentifyer + "=").append(uid).append(",");
  		sb.append(Configuration.getProperty(instanceName + LdapKeys.ATTR_OU_PEOPLE)).append(",");
  		sb.append(baseDn);
  		if (uid == null || uid.isEmpty() || password == null || password.isEmpty()) {
  			return false;
  		}
  		try {
  			Hashtable<String, String> environment = (Hashtable<String, String>) ctx.getEnvironment().clone();
  			environment.put(Context.SECURITY_PRINCIPAL, sb.toString());
  			environment.put(Context.SECURITY_CREDENTIALS, password);
  			DirContext dirContext = new InitialDirContext(environment);
  			status = setUserInContext(dirContext, node);
  			dirContext.close();
  		} catch (NamingException ex) {
  			handleNamingException("NamingException " + ex.getLocalizedMessage(), ex);
  		}
  		return status;
  	}
docs: Writes the modifications on an user object back to the LDAP using a
  specific context.
  
  @param node the LDAP Node with User Content.
  @param uid the uid of the User that adds the Node.
  @param password the password of the User that adds the Node.
  @return true if the user was set correct, false otherwise.
  @throws Exception if adding a User fails.