Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logoff #31

Closed
eljeffeg opened this issue May 15, 2012 · 4 comments
Closed

Logoff #31

eljeffeg opened this issue May 15, 2012 · 4 comments

Comments

@eljeffeg
Copy link

The new Facebook App requirements specify that a logout method is necessary. Any chance of adding this to the facebook-sdk? Thanks

@martey
Copy link
Member

martey commented May 15, 2012

@jeffg2k, how would you propose implementing logging out from the API in Python?

@eljeffeg
Copy link
Author

I thought since the API had stuff for oauth, getting the access token, auth_url, that perhaps something could be added that logged off the user from that access token. Wasn't sure if it should go in here or what would need to be done. I've tried it in Javascript, but my app, based on the soccialcookbook just logs them right back in. So I thought that it probably needed to be done in the python code that is the backend, which uses facebook-sdk.

@martey
Copy link
Member

martey commented May 16, 2012

Facebook's Graph API does not contain a method to invalidate access tokens, so there is no way for this SDK to "logout" a user (especially since the GraphAPI object does not store the state of users or the validity of its access token.

A quick look at socialcookbook suggests that the code does not use this SDK or Facebook's original code, and instead compiles Graph API requests directly. As a result, the issue you created at the socialcookbook repository is probably a better place to get answers.

More importantly, note that FB.logout will only work properly if you are also using the JavaScript SDK for login (e.g. if you use the get_user_from_cookie method). If you are using server-side OAuth authentication (e.g. with auth_url and get_access_token_from_code) - as socialcookbook seems to, how you logout will depend on your application's structure.

@martey martey closed this as completed May 16, 2012
@eljeffeg
Copy link
Author

Thanks for the thoughtful and detailed reply Martey, much appreciated. Sorry about the confusion, I must be using facebook-sdk for something else and got confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants