Facebook manual logout

北战南征 提交于 2019-12-11 06:08:27

问题


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.


回答1:


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

Basically it just calls https://www.facebook.com/logout.php with two parameters:

  • next is the redirect URI the user should be redirected back to after logout; it needs to be within your app domain
  • access_token is the valid user access token for the current user of your app


来源:https://stackoverflow.com/questions/42302898/facebook-manual-logout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!