Bad Banana
Bad Banana

Reputation: 307

How to logout user from the Facebook when he does not authorize the application

I have ASP.NET web application that

  1. Runs on public computers
  2. Allows users to register by using their Facebook accounts.
  3. Must always logout a user from the Facebook after registration has been completed.

Registration process contains the following steps:

  1. Registration page is shown with the Facebook icon.
  2. When user clicks on the Facebook icon, he is redirected to the Facebook web site.
  3. On the Facebook site user enters his email and password and clicks login.
  4. On the Facebook site user clicks Allow to authorize my application.
  5. User is redirected to my application.
  6. The application registers used in the database.
  7. The application calls FB.logout in order to logout from the Facebook. So when new user starts registration he cannot use account of previous user.

The application works perfect until user clicks Cancel at step 4. When this happens, the browser is redirected to my application, the user remains signed into the Facebook but the application is not authorized by this user. This means that the application cannot logout this user from the Facebook by using the FB.logout method because the application does not have access token.

How to logout from the Facebook in this case?

Thank you.

Upvotes: 0

Views: 368

Answers (1)

C3roe
C3roe

Reputation: 96316

How to logout from the Facebook in this case?

Not possible at all.

If logging a user out without a valid access token was possible, then every website I’m visiting could do that if they liked – I’m sure you can see how annoying that’d be to users, and that it’s therefor not possible.

Upvotes: 0

Related Questions