Facebook手动登出 [英] Facebook manual logout
问题描述
我有一个.net网站,旨在用作独立应用程序.由于一个问题,我不得不手动执行登录到Facebook的流程,而不是调用FB.login(来自FB javascript sdk).因此,我无法调用FB.logout(因为在这种情况下,还会出现另一个问题). Facebook支持建议我: 在这种情况下,您应该通过清除所有存储的cookie或删除任何存储在我们端的访问令牌或用户信息来手动清除用户的登录会话.有关手动构建登录/注销流程的更多信息,请参阅此页面. : https://developers.facebook. com/docs/facebook-login/manually-build-a-login-flow/#logout " 我没有得到这个答案.如何实现手动注销工作流程? 而且我没有找到任何例子.
I have .net web site which designed for working as standalone application. Due to one issue I was made to perform login flow to Facebook manually instead of calling FB.login(from FB javascript sdk). And because of this I am not able to call FB.logout (because in this case another issue appears). Facebook support advised me this: "In this case, you should manually clear the user's logged in session, by clearing any stored cookies, or removing any access tokens or user information stored on our end. You can refer to this page for more information on building login/logout flows manually: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/#logout" I didn't get this answer. How to realize manually logout workflow? And I didn't find any examples.
推荐答案
您可以在此处检查PHP SDK的getLogoutUrl
方法的作用,
You can check what the PHP SDK’s getLogoutUrl
method does here, https://github.com/facebook/php-graph-sdk/blob/5d0c4865e80e231d48a4571841bd018828fe58e1/src/Facebook/Helpers/FacebookRedirectLoginHelper.php#L156
基本上,它只是使用两个参数调用https://www.facebook.com/logout.php
:
Basically it just calls https://www.facebook.com/logout.php
with two parameters:
-
next
是注销后用户应重定向回的重定向URI;它必须在您的应用域内 -
access_token
是您应用的当前用户的有效用户访问令牌
next
is the redirect URI the user should be redirected back to after logout; it needs to be within your app domainaccess_token
is the valid user access token for the current user of your app
这篇关于Facebook手动登出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!