Facebook 帐户取消链接或取消授权 Facebook 应用程序并检查 Facebook 应用程序的链接状态
我的网站应用程序具有通过 Facebook 登录进行登录的功能。为此,我的应用程序出现在 Facebook 上。使用 Facebook 登录工作正常。
但应用程序具有将 Facebook 帐户链接和取消链接到 Facebook 应用程序的功能。
- 如何检查 FB 帐户是否与特定 FB 应用程序关联?
- 如果已链接(根据该用户的请求),如何取消 FB 帐户与特定 FB 应用程序的链接?
(“链接”意味着我们根据要求选择“允许”FB 应用程序)
My website application having feature login with Facebook login. And for which my app is present on Facebook. Login with facebook is working fine.
But application have feature of linking and unlinking facebook account to Facebook app.
- How to check FB account is linked with specific FB app or not?
- And how to unlink FB account from specific FB app if linked (On that user's request )?
("Linked" means we select "Allow" to FB app on request)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
对于新的 Graph,有一种记录在案的取消授权方法(我已经在 Graph API 资源管理器中对其进行了测试,并且它有效)。使用有效的访问令牌向“me/permissions”发送 HTTP 删除命令。它不仅会使访问令牌失效,还会从用户的身份验证应用程序列表中删除该应用程序。这需要用户再次授权应用程序(通过权限屏幕)才能使用它。快乐编码!
With the new Graph there is a documented way to deauthorize (I've tested it in the Graph API explorer and it works). Send an HTTP Delete command to "me/permissions" with a valid access token. Not only will it invalidate the access token, but it also removes the app from the user's list of auth apps. This requires the user to authorize the app again (going thru the permissions screens) to use it. Happy coding!
请注意 Facebook 正在弃用 REST API,并为 Graph API 用户对象添加了对“auth.revokeAuthorization”方法的等效支持。
Please note Facebook in the process of deprecating the REST API, and have adding equivalent support to the Graph API User object for "auth.revokeAuthorization" method.
这可以通过简单的 FQL 查询轻松实现:
如果用户与应用程序连接,则将返回用户的 uid,否则不会返回任何内容
This can easily achieved with simple FQL query:
This will return uid of user if he is connected with app and nothing otherwise
使用您的应用访问权限对
/{USER_ID}/permissions
进行 API 调用令牌,它将显示该用户是否已授权您的应用程序。您还可以检查用户的访问令牌(如果有)。
响应类型将如下所示:
对于用户授予您的应用程序的每一项扩展权限,都会有一个条目,并且
installed
行意味着他们已经安装了您的应用程序对于尚未安装的用户如果没有安装您的应用程序,则响应将是:
您还可以使用 FQL,如 Juicy Scripter 在另一个答案中建议的那样
Make an API call to
/{USER_ID}/permissions
with your App access token and it will show if that user has authorised your appYou can also check with the user's access token if you have one.
The response type will be something like this:
There'll be one entry there for each extended permission the user has granted your app and the
installed
line means they've installed your appFor a user who hasn't installed your app the response will be:
You can also use FQL as Juicy Scripter suggests in another answer
以下是如何使用 Facebook iOS SDK v4 取消对应用程序的授权:
Here's how to deauthorize your app using Facebook iOS SDK v4:
通过 Graph API,来自文档(感谢@DMCS):
旧的 REST API 为您提供 auth.revokeAuthorization。您可以在auth.revokeAuthorization 文档上了解更多相关信息。
请注意,REST API 将来将会被弃用,尽管 Facebook 没有具体说明何时弃用。
我不知道有什么方法可以获取给定用户所连接的应用程序列表,也不知道 Facebook 提供该列表的任何原因。要查看用户是否连接到您的应用程序,此处的其他答案应该可以为您提供一些想法。
Through the Graph API, from the docs (thanks @DMCS):
The olds REST API offers you
auth.revokeAuthorization
. You can read more about that on the auth.revokeAuthorization docs.Be aware that the REST API will be deprecated in the future, although Facebook doesn't specify when exactly.
I am not aware of any way to get a list of apps a given user is connected to, or see any reason Facebook would make that available. To see if a user is connected to your app, the other answers here should provide you with a couple of ideas.