I have upgraded my js FB Connect to oauth version & when I am trying to logout from FB programatically using FB.logout() method, I am getting error like
"FB.logout() called without an access token"
What is the problem behind this? I saw one thread over here but it didn't worked for me. Please help me if someone has found solution for this. Thanks.
An access token is an opaque string that identifies a user, app, or Page and can be used by the app to make graph API calls. When someone connects with an app using Facebook Login and approves the request for permissions, the app obtains an access token that provides temporary, secure access to Facebook APIs.
OAuth is also used when giving third-party apps access to accounts like your Twitter, Facebook, Google, or Microsoft accounts. It allows these third-party apps access to parts of your account. However, they never get your account password.
This is what i've used before.
//check if logout is
FB.getLoginStatus(function(ret) {
/// are they currently logged into Facebook?
if(ret.authResponse) {
//they were authed so do the logout
FB.logout(function(response) {
//do your stuff here.
});
} else {
///do something if they aren't logged in
//or just get rid of this if you don't need to do something if they weren't logged in
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With