code: private static String generateBase64Authentication(String username, String password) {
      requireNonNull(username, password);
      String userPass = username + ":" + password;
      String userPassBase64 = Base64.getEncoder().encodeToString(userPass.getBytes(UTF_8));
      return "Basic " + userPassBase64;
    }
docs: Generate base64 authentication based on username and password.
  
  @return Authentication header value.