GithubHelp home page GithubHelp logo

Logoff about facebook-sdk HOT 4 CLOSED

mobolic avatar mobolic commented on July 18, 2024
Logoff

from facebook-sdk.

Comments (4)

martey avatar martey commented on July 18, 2024

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

from facebook-sdk.

eljeffeg avatar eljeffeg commented on July 18, 2024

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.

from facebook-sdk.

martey avatar martey commented on July 18, 2024

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.

from facebook-sdk.

eljeffeg avatar eljeffeg commented on July 18, 2024

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.

from facebook-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.