/*
Sets the authentication information that should be used for the connector

@param username the username
@param password the password
@return this
354521
public FTP auth(String username, String password) {
        return username(username).password(password);
    }
896105
public void setPassword(char[] password) {

        LettuceAssert.notNull(password, "Password must not be null");
        this.password = Arrays.copyOf(password, password.length);
    }
714660
public Request authorize(String name, String password){
        String authString = name + ":" + password;
        System.out.println("auth string: " + authString);
        byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
        String authStringEnc = new String(authEncBytes);
        System.out.println("Base64 encoded auth string: " + authStringEnc);
        return this.authorization("Basic " + authStringEnc);

    }
408748
public static Authentication plain(String username, String password) {
        return new AuthenticationImpl(username, password, AuthMode.Plain);
    }
315271
public void setUser(String userName, String password){
        if(userName != null && ! userName.isEmpty()){
            connection.setDirectoryUser(userName, password);
        }
    }
367236
protected boolean configureUsernamePassword(final GitHubClient client,
			final String userName, final String password) {
		if (StringUtils.isEmpty(userName, password))
			return false;

		if (isDebug())
			debug("Using basic authentication with username: " + userName);
		client.setCredentials(userName, password);
		return true;
	}
1261245
public void setPassword(CharSequence password) {

        LettuceAssert.notNull(password, "Password must not be null");
        this.password = password.toString().toCharArray();
    }
1282012
public CRestBuilder basicAuth(String username, String password) {
        this.auth = "basic";
        this.username = username;
        this.password = password;
        return this;
    }
113518
public void signin(String username, String password) {
		logger.debug("signin:" + username);

		Authentication request = new UsernamePasswordAuthenticationToken(username, password, null);
		SecurityContextHolder.getContext().setAuthentication(request);
	}
998789
public void setCredentials(String username, String password) {
        this.username = username;
        this.password = password;
    	authorization = "Basic " + Base64.getEncoder().encodeToString(filesystem.getWorld().getSettings().bytes(username + ":" + password));
    }
225885
public T authentication(String username, String password) {
        return authentication(username, password, false);
    }
816232
public void setCredential(String username, String password) {
	if (username != null) {
	    env.put("java.naming.security.principal", username);
	    env.put("java.naming.security.credentials", password);
	}
	else {
	    env.remove("java.naming.security.principal");
	    env.remove("java.naming.security.credentials");
	}
    }
833939
public function setCredentials(string $username, string $password)
    {
        $userpwd = $username . ':' . $password;
        curl_setopt($this->curl, CURLOPT_USERPWD, $userpwd);
    }
1098845
public function setAuth($username = null, $password = null)
    {
        $this->username = $username;
        $this->password = $password;
    }
1163288
public void connect(String username, char[] password) {
        doConnect(() -> {
            return CommandContextFactory.getInstance().
                    newCommandContext(new CommandContextConfiguration.Builder()
                    .setUsername(username)
                    .setPassword(password)
                    .setErrorOnInteract(false)
                    .build());
        });
    }
121936
public Principal authenticate(String username, char password[]) 
    throws NamingException
	{
		DirContext ctx = null;
		try
		{
			String userDN = toDN(username);
			ctx = initContext(userDN, password);

			return new X500Principal(userDN);
		}
		finally
		{
			if(ctx != null)
				try{ ctx.close(); } catch(Exception e){e.printStackTrace();}
		}
	}
1048084
@Override
    public void setPassword(final String password) {
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "setPassword", "***");
        }
        _password = password;
    }