[英]How to save and refresh Facebook access token of user (admin)
I am thinking to implement Facebook Wordpress Plugin for bloggers in django (using Fandjango & Facepy ). 我正在考虑为django的博客作者实现Facebook Wordpress插件 (使用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. 因此,应用程序需要在后台自动在管理员上执行
/friend_id/feed
调用。
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: 现在,我有一些问题要解决:
Actually, can we store access token (I mean securely). 实际上,我们可以存储访问令牌吗(我的意思是安全)。 I somewhere read that its not possible (not sure of the information)
我在某处读到它是不可能的(不确定信息)
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: 如果用户将其授权为应用程序,则其权限为
publish_stream
(将故事发布到用户及其好友的新闻源)和user_likes
(可访问用户喜欢的页面),您可以使用:
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. 然后,使用Graph API,JS SDK或PHP SDK来发布故事,这非常简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.