I'm trying to let a user post an image on my website to an album on a specific facebook-page. Before he's able to select an image on his computer he needs to be logged in at facebook and must have given the needed rights to our application (casual flow)
For posting the selected image to the album of our page we need an access token so we have the right permissions to do this. We can get the permissions by hand by doing the following steps:
Navigate to the url below logged in as the admin of the page, and give the permissions (user_photos,manage_pages,offline_access,publish_stream)
https://www.facebook.com/dialog/oauth? client_id=<application_id> &redirect_uri=<canvas_url> &response_type=token &scope=user_photos,manage_pages,offline_access,publish_stream
When you give the application the required permissions you'll be redirected to canvas_url#access_token=*access_token*, for example
http://example.com/#access_token=awe12
Then navigate to
https://graph.facebook.com/me/accounts?access_token=#access_token (using the access token from 2).
This will list the pages you administer; write down the access_token for the page(s) to which you want to upload the image
Now, is there a way to do this automagically? Or better, is there a way to generate an access-token for this page, that will never expire?