title: Java + RestFB API: Getting fresh Page Access Token without messing with AppID, appSecret
body: <h2>What I want to do:</h2>
  
  <p>I am trying to make a simple program that posts 5-10 statuses, at a time, on a page's wall. The post to the page will have to be done <strong>under the name of the page</strong>.</p>
  
  <p>I've read tons of badly written Facebook Developers documentation and I'm reaching the point of confusion where I don't even know what questions to ask. So her I am.</p>
  
  <hr>
  
  <h2>My code so far:</h2>
  
  <p>I manually got the Page Access token manually, by this method:</p>
  
  <ol>
  <li>Go to <a href="https://developers.facebook.com/tools/explorer" rel="nofollow">https://developers.facebook.com/tools/explorer</a></li>
  <li>At the GET request form, down there, fill in me/accounts</li>
  <li>You'll get a Javascript representation of your basic user data. Find the page you want.</li>
  <li>Note the access_token and id fields, we're going to use them in the code below.</li>
  </ol>
  
  <p>Thus, after getting the page Access token manually (And the ID of the page, of course)</p>
  
  <pre><code>import com.restfb.DefaultFacebookClient;
  import com.restfb.FacebookClient;
  import com.restfb.Parameter;
  import com.restfb.exception.FacebookException;
  import com.restfb.types.FacebookType;
  import com.restfb.types.Page;
  import com.restfb.types.User;
  
  /**
   *
   * @author dsfounis
   */
  public class FacebookConnector {
  
      /* Variables */
      private final String pageAccessToken = "GOT_THIS_FROM_THE_METHOD_ABOVE";
      private final String pageID = "THIS_TOO";
      private FacebookClient fbClient;
      private User myuser = null;    //Store references to myr user and page
      private Page mypage = null;    //for later use. In this question's context, these
                                     //references are useless.
      private int counter = 0;
  
      public FacebookConnector() {
          try {
  
              fbClient = new DefaultFacebookClient(pageAccessToken);
              myuser = fbClient.fetchObject("me", User.class);
              mypage = fbClient.fetchObject(pageID, Page.class);
              counter = 0;
          } catch (FacebookException ex) {     //So that you can see what went wrong
              ex.printStackTrace(System.err);  //in case you did anything incorrectly
          }
      }
  
      public void makeTestPost() {
          fbClient.publish(pageID + "/feed", FacebookType.class, Parameter.with("message", Integer.toString(counter) + ": Hello, facebook World!"));
          counter++;
      }
  
  }
  </code></pre>
  
  <hr>
  
  <h2>The problem:</h2>
  
  <p><strong>The code above works.</strong> The thing is, <strong>it works temporarily</strong>. The <code>page access token</code> that I get has an expiration time of one hour, and I need to manually go through the process of obtaining it, every time that I run the program. What is the point of automating a process if I keep some aspects of it manual?</p>
  
  <p>So I have to ask you: <strong>Can I do the process above programmatically</strong>, and obtain a fresh <code>page access token</code> at program launch?</p>
  
  <p>Can I, maybe, use a better API to do something as simple as <em>just post a couple of things on a Page's wall, every day?</em></p>
  
  <p>My application is a console one, and I would like to stay away from implementing needless Logins, even though if you tell me that it is needed, it's going to be a bother I'll have to go through.</p>
  
  <p><strong>As a note:</strong> I've got the application registered in Facebook Developers, albeit only as a basic app. To get more permissions, I need to show proof of Facebook Login implementation, and as I say in the title, it's something I'll have to avoid.</p>