如何将访问令牌从一个网站传递到另一个网站?
我有一个网站,负责通过 Graph / OAuth 获取 Facebook 令牌。此时,该网站可以毫无问题地向用户的 Facebook 墙发布内容。
是否可以将此令牌发送到另一个网站,以便远程网站可以开始发布用户的 Facebook 墙,而无需重新登录用户?
I have a website that takes care of getting a Facebook token through Graph / OAuth. At that point, the website can post to the user's Facebook wall with no problems.
Is it possible to send this token to another website so the remote website can start posting the user's Facebook wall without re-logging in the user?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
访问令牌是按应用程序 ID 授予的,而不是按域授予
的也就是说,除非您的访问令牌包含
offline_access
权限,否则访问令牌会绑定到当前会话,因此即使您设法将其“传递”到另一个域,如果用户(Facebook)注销,它将无法工作。所以,是的,在适当的情况下这应该是可能的。
Access tokens are granted per APP ID, not per domain
That being said, unless your access token includes the
offline_access
permission, access tokens are bound to the current session so even if you managed to "pass" it to another domain, it wouldn't work if the user was logged out (of Facebook).So, yes it should be possible under the right circumstances.