/*
@param username the username the proxy requires
@param password the password the proxy requires
@return this
972434
public DataSiftConfig proxy(String host, int port, String username, String password) {
        http.proxy(host, port, username, password);
        return this;
    }
493453
public GitRepositoryBuilder credentialProvider(final String username, final String password) {
        if (StringUtils.hasText(username)) {
            this.credentialsProviders.add(new UsernamePasswordCredentialsProvider(username, password));
        }
        return this;
    }
19245
public SFTP auth(String username, String password) {
        return username(username).password(password);
    }
1237091
@SuppressWarnings("unused")
    public void setBasicAuth(@Nullable String username, @Nullable String password) {
        mUsername = username;
        mPassword = password;
    }
1355250
public static String createAuthorization(final String username,
            final String password) {
        return new String(Base64.encodeBase64((username + ":" + password)
                .getBytes()));
    }
359096
public FTPUploadRequest setUsernameAndPassword(String username, String password) {
        if (username == null || "".equals(username)) {
            throw new IllegalArgumentException("Specify FTP account username!");
        }

        if (password == null || "".equals(password)) {
            throw new IllegalArgumentException("Specify FTP account password!");
        }

        ftpParams.username = username;
        ftpParams.password = password;
        return this;
    }
916983
public static AuthInfo plain(String username, String password) {
    return new AuthInfo(new PlainCallbackHandler(username, password), new String[] {"PLAIN"});
  }
447451
public static boolean authenticate(String userName, String userPassword) {
        LOGGER.entering(userName, StringUtils.isBlank(userPassword) ? userPassword : userPassword.replaceAll(".", "*"));
        boolean validLogin = false;
        byte[] currentAuthData;
        byte[] hashedInputData;
        if (StringUtils.isBlank(userName) || StringUtils.isBlank(userPassword)) {
            return validLogin;
        }
        try {
            File authFile = new File(AUTH_FILE_LOCATION);
            if (!authFile.exists()) {
                authFile.createNewFile();
                createAuthFile(authFile, DEFAULT_USERNAME, DEFAULT_PASSWORD);
            }
            currentAuthData = getBytesFromFile(authFile);
            hashedInputData = hashData(userName, userPassword);
            validLogin = Arrays.equals(currentAuthData, hashedInputData);
        } catch (Exception e) {
            validLogin = false;
        }
        LOGGER.exiting(validLogin);
        return validLogin;
    }
1157341
public Credentials toCredentials(String username, String password) {
	return CredentialsImpl.toCredentials(username, password);
    }
513396
public static void putPasswordResetUsername(final RequestContext requestContext, final String username) {
        val flowScope = requestContext.getFlowScope();
        flowScope.put("username", 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;
	}
399888
public ArtifactoryBuildInfoClient createArtifactoryClient(String userName, String password,
                                                              ProxyConfiguration proxyConfiguration) {
        return createArtifactoryClient(userName, password, proxyConfiguration, new NullLog());
    }
650268
public static void setUser(String userName, String password){
        getImpl().getDirectoryServiceClient().setUser(userName, password);
    }
1123830
public Proxy setAuthentication( Authentication auth )
    {
        if ( eq( this.auth, auth ) )
        {
            return this;
        }
        return new Proxy( type, host, port, auth );
    }
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();}
		}
	}
659188
public static Condition basicAuth(String username, String password) {
        final String authString = username + ":" + password;
        final String encodedAuthString = new String(Base64.encodeBase64(authString.getBytes()));
        return new Condition(input -> ("Basic " + encodedAuthString).equals(input.getAuthorization()));
    }
358745
public GrpcChannelBuilder setCredentials(String userName, String password,
      String impersonationUser) {
    mUserName = userName;
    mPassword = password;
    mImpersonationUser = impersonationUser;
    mUseSubject = false;
    return this;
  }