How do I log a user out of my FB app but not Facebook site?

白昼怎懂夜的黑 提交于 2019-12-12 13:25:32

问题


I am using Facebook login integration on my asp.net site. What I want is that when a user logs off the site, I want him to also log off the FB application, but not Facebook itself. If I call FB.logout(), it logs off FB as well as the app. I guess what I want is to lose the acess_token cookie for the app, but I can't figure it out.


回答1:


FB.api({ method: 'Auth.revokeAuthorization' });



回答2:


I dont think that is possible as the login for both the application and FB is done using FB credentials..

In case you want to de-authorize the user from your application you can issue an HTTP DELETE request to /PROFILE_ID/permissions to revoke authorization for an app.




回答3:


I'm not sure this is a good idea. Even if you removed the session for your website, if they are still logged into facebook, they may as well still be logged into your website. They are essentially the same thing. You need to log them out of facebook to ensure their security on your site, otherwise it just takes someone sharing the pc or cookie sniffing, to get access to their account on your site

edit: also, if you just want to delete the cookie, you can simply do this with javascript.



来源:https://stackoverflow.com/questions/7425595/how-do-i-log-a-user-out-of-my-fb-app-but-not-facebook-site

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