Calls this to provide username and password. This will use Basic authentication, with a header such as
"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="

@param username user name
@param password password
429848
public void setBasicUsernamePassword(String username, String password) {
        this.username = username;
        this.password = password;
        LOG.debug("use basic username/password {}/********", username);

        userPassCredentialsProvider = new BasicCredentialsProvider();
        userPassCredentialsProvider.setCredentials(AuthScope.ANY,
            new UsernamePasswordCredentials(username, password));

        authCache = new BasicAuthCache();
        BasicScheme basicAuth = new BasicScheme();
        authCache.put(httpHost, basicAuth);
    }
98800
@CommandArgument
  public void passwd(
      @OptionArgument("username") String username,
      @OptionArgument("password") String password) {

    User user = users.get(username);

    if (user != null) {
      user.salt = passwd.generateSalt();
      user.hash = passwd.getEncryptedPassword(password, user.salt);
    } else {
      System.err.println(String.format("User '%s' does not exist", username));
    }

  }
1207144
public HttpRequest basicAuth(String username, String password) {
		final String data = username.concat(":").concat(password);
		final String base64 = Base64.encode(data, charset);

		header("Authorization", "Basic " + base64, true);

		return this;
	}
1331235
public static YggdrasilAuthenticator password(String username, String password) throws AuthenticationException {
		return password(username, password, null);
	}
568300
public login login(String username, String password) throws Exception
	{
		this.set_credential(username, password);
		return this.login();
	}
225885
public T authentication(String username, String password) {
        return authentication(username, password, false);
    }
632479
public static String encodeBasicAuth(final String username, final String password) {
        requireNonNull(username, "username");
        requireNonNull(password, "password");
        final String auth = username + ':' + password;
        byte[] encoded;
        try {
            encoded = Base64.getEncoder().encode(auth.getBytes(UTF_8));
        } catch (final IllegalArgumentException e) {
            throw new IllegalArgumentException("Failed to encode basic authentication token", e);
        }
        return BASIC_AUTH_PREFIX + new String(encoded, UTF_8);
    }
1167973
public void login(String username, String password) throws IOException {
        String requestUrl = RESOURCE + "/login";
        Credentials creds = new Credentials();

        creds.setPassword(password);
        creds.setUsername(username);

        ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.POST, requestUrl, creds);

        try {
		assertValidResponse(response, requestUrl);
	} catch (TokenExpiredException e) {
		//This should never happen
		throw new RuntimeException("This should never happen. login() method should never throw a TokenExpiredException", e);
	}
        
        Map<String, String> tokens = fromJson(response.getResult(), new TypeReference<Map<String, String>>() {});
        getClient().accessToken = tokens.get("accessToken");
        getClient().refreshToken = tokens.get("refreshToken");
    }
282045
@Override
    public Subject authenticate(String username, @Sensitive String password) throws AuthenticationException {
        AuthenticationData authenticationData = createAuthenticationData(username, password);
        return authenticationService.authenticate(jaasEntryName, authenticationData, null);
    }
570803
function setAuthorization($username,$password){
		settype($username,"string");
		settype($password,"string");

		$this->_Username = $username;
		$this->_Password = $password;
		$this->_AuthType = "basic";
	}
1165638
public function setAuthCredentials($username, $password)
    {

        $this->setUsername($username);

        $this->setPassword($password);

        $this->authCredentials = base64_encode(
            "{$this->username}:{$this->password}"
        );

    }
118131
public boolean isCredentialsValid(String username, String password) {
        try {
            String token = getTokenAuthenticationManager().login(StringUtil.toEmptyIfNull(username), StringUtil.toEmptyIfNull(password));
            getTokenAuthenticationManager().logout(token);

            return true;
        } catch (Exception ex) {
            return false;
        }
    }
354521
public FTP auth(String username, String password) {
        return username(username).password(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;
	}
696121
public void setUserName(String userName) {
        SystemAssert.requireArgument(userName != null && !userName.isEmpty(), "Username cannot be null or empty.");
        this.userName = userName;
    }
963397
public void setCredentials(String username, String password) {
                if (GitTaskUtils.isNullOrBlankString(username) || GitTaskUtils.isNullOrBlankString(password)) {
                        throw new IllegalArgumentException("Credentials must not be empty.");
                }

                credentials = new UsernamePasswordCredentialsProvider(username, password);
        }
19245
public SFTP auth(String username, String password) {
        return username(username).password(password);
    }