0

I am thinking to implement Facebook Wordpress Plugin for bloggers in django (using Fandjango & Facepy).

To be specific:

The project admin/ developer will be the only person as user. So, the application need to perform /friend_id/feed calls on the admin automatically in the background.

For that all I would need is to store admin's access token and use it when ever I want..

Now, I got some problems to address:

  1. How to refresh the admin's access token when it expires automatically without admin's intervention

Actually, can we store access token (I mean securely). I somewhere read that its not possible (not sure of the information)

Surya
  • 4,824
  • 6
  • 38
  • 63

1 Answers1

1

If the user authorizes this as an app, with the permissions publish_stream (to publish stories to the News Feeds of the user and their Friends) and user_likes (to have access to the pages at the user has 'liked'), you can use:

https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials

to create an App access token. Since these do not often change, you can store it if you like, but it may be wise to make the above request each time, so that in case it does change, you are somewhat protected.

Then, use the Graph API, JS SDK or PHP SDK to publish the story, which is quite straightforward.

Cal McLean
  • 1,408
  • 8
  • 15
  • actually, I just came to know about this kind of request (actions through app itself) but I wonder on what name the actions are published. Say my app name is **wp** and I am **surya**, If I publish under app access token, will they get published by **surya** or **wp** . ex: **`wp / surya published an article`** – Surya Sep 16 '12 at 15:39
  • IIRC, it would usually display a standard post (your name and photo on the left, etc), but the timestamp underneath would read 'x minutes ago via wp'. After all, the point of authenticating as an app is so that the app can post on the users' behalf. – Cal McLean Sep 16 '12 at 16:05