从 user_id 获取用户访问令牌(应用程序已授权)
我有一个在 Facebook 上运行的民意调查应用程序(每个用户每天都会投票)。到目前为止,我还没有在数据库中存储用户访问令牌。现在已更新,此时我将保留访问令牌。每次用户投票时,我都会保存他的访问令牌。
我的问题是如何从之前的投票中获取用户的访问令牌,考虑到他们已经授权了我的应用程序,这是否可能?有没有办法呢?我有用户 ID。
(需要这个的唯一原因是从 FB 图 API 获取“is_verified”属性)
感谢您的帮助,
Hugo
I have a poll app running on facebook (each user gets a vote each day). Until now I didn't store on my database the user access token. This is now updated and I'm keeping the access token by this time. Each time a user votes I save his access token.
My problem is how to get the user's access token from previous votes, is this possible considering that they have authorized my app? Is there a method for this? I have the users id.
(the only reason for needing this is to get the "is_verified" property from FB graph API)
Thanks for your help,
Hugo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
未经身份验证,您无法获取用户
access_token
。不过,您可以将您的用户应用程序发送给用户请求,吸引用户访问您的应用程序,以便您能够存储用户的
access_token
。请注意
access_token
可能会过期并且offline_access
权限已弃用(很快就会被删除),您可以将令牌延长最多 60 天(延长仅适用于重新验证的用户,尚未验证的用户)...You cannot get user
access_token
without authenticate him.You can however send your users app to user request engaging user to visit your application so you'll be able to store user's
access_token
.Beware that
access_token
may expire andoffline_access
permission is deprecated (and will be removed soon), you can extend tokens up to 60 days (extending will only works for users who re-authenticated, not already authenticated)...