title: How to get Page Access Token by code?
body: <p>I need to generate a Page Access Token for a webpage that I have, this token will be used by the webpage to post to its Facebook Page feed.</p>
  
  <p>This is what I do : </p>
  
  <ol>
  <li>Go to <a href="http://developers.facebook.com/tools/explorer/">Graph API Explorer</a></li>
  <li>Choose my app from the dropdown</li>
  <li>Click <code>Get Access Token</code></li>
  <li>Choose correct permissions(<code>manage_pages</code>/<code>user_events</code>)</li>
  </ol>
  
  <p>To get the <code>Page Access Token</code> I have to run <code>me/accounts</code> in the Graph API Explorer. This will show all the pages I got with a new Page Access Token (short lived(about 60 min)) to each one.</p>
  
  <p>This <code>Page Access Token</code> will work just fine to use in my C# code to post to the feed.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>When another user uses my webpage to post a post I need to generate a new <code>Page Access Token</code>(in code) and then use it to post the userpost to the site´s facebook feed. The problem is that I could clearly not be there to grant the post so how do I handle this?</p>
  
  <p>I could obviously not run the <code>me/accounts</code>(in code) command to get the <code>Page Access Token</code> from here.</p>
  
  <p>I have looked at extended Access Token but this will last 60 days and then it will be the same problem as above. </p>