title: RestFB: Using a facebook app to get the users Access Token
body: <p>This is what i have:</p>
  
  <pre><code>static AccessToken accessToken = new DefaultFacebookClient().obtainExtendedAccessToken("&lt;my app id&gt;", "&lt;my app secret&gt;");
  static FacebookClient client = new DefaultFacebookClient();
  public static void main(String args[]) {
      System.out.print("Enter Your Status: ");
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
      String status= null;
  
        try {
           userName = br.readLine();
           System.out.println("..........");
        } catch (IOException ioe) {
           System.out.println("!");
           System.exit(1);
        }
  
      FacebookType publishMessageResponse =
                  client.publish("me/feed", FacebookType.class,
                  Parameter.with("message", status));
  </code></pre>
  
  <p>So first line gets the token and stores it as type AccessToken but what good does that do to me because next line i need to provide the access token as a string and i can't convert it. Any Help?</p>