title: Where do I get an access token from to post to my facebook page using FBGraph gem in Rails 3?
body: <p>I am posting to a page on MY Facebook account from my web site using FBGraph gem but how do I get my access token?
  I am certain that my code is correct to post to the page I need</p>
  
  <pre><code>  def send_fb_message(params = {})
      owner = FbGraph::User.me(FB_TOKEN)
      pages = owner.accounts
      page = pages.detect do |page|
        page.identifier == FB_PAGE_ID
      end
      page.feed!(
        :message =&gt; params[:message],
        :description =&gt; params[:description],
        :link =&gt; params[:link]        )
    end
  </code></pre>
  
  <p>As you can see FB_TOKEN is a constant, perhaps it should be a variable but whatever it needs to be I have no idea how to get the value for the access token. (All permissions have been accepted by my facebook account including manage_pages permission.)</p>
  
  <p>I have a secret and an app id for my Facebook app and I'm using the graph api but there seems to be nowhere for me to make use of these.</p>
  
  <p>The app login docs here <a href="http://developers.facebook.com/docs/authentication/#applogin" rel="nofollow">http://developers.facebook.com/docs/authentication/#applogin</a> don't make it clear to me at all as to how to obtain the access token neither does the docs for the FBGraph gem unless I am missing something?</p>
  
  <p>Is there a better way?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Thank's to the reply from @Lego below I have been able to make this post work using a token using the access token tool <a href="https://developers.facebook.com/tools/access_token/" rel="nofollow">https://developers.facebook.com/tools/access_token/</a>. I can see the post if I am logged in as my user but I am unable to see the post if I am not logged in
  How do I make this post public?</p>