1

Facebook appears to have changed the SSO page so that users can't log out / switch accounts directly. What I mean is this:

a) you have any iOS App installed that uses the Facebook SDK, for example Voxer (not my app), and you do do not have the Facebook App installed
b) you log in normally via Safari
c) you log out again and try to switch the user, but the screen displayed on Safari only allows you to sign in the same user again (OK Button).

It is possible to navigate to facebook.com and log out there, but that is not intuitive at all for most users. Telling people to install the Facebook App is not very user-friendly either.

I have found nothing about this either on developers.facebook.com or here, am I missing something or should I submit a bug report?

Thanks, Sebastian

SebastianC
  • 11
  • 1
  • 3
  • Apparently, the problem solved itself: the screen is back to normal. – SebastianC Mar 07 '12 at 09:26
  • Sebastian, did you do anything to make the screen go back to normal? I have the same problem, the only button it shows is the "Okay" button, not allowing me to log out. – flavianatill Mar 09 '12 at 12:51
  • hey lancelotavery. I didn't do anything, after a few days the normal screen comes up again. The other screen, by the way, was on several devices for several users, so I'd pin the problem on Facebook. – SebastianC Mar 12 '12 at 07:00

1 Answers1

2

I spent the better part of a day working on this issue. I have discovered that when you use SSO and the call:

Called from your code:

[facebook logout:self];

Facebook API method:

- (void)logout:(id<FBSessionDelegate>)delegate {

  self.sessionDelegate = delegate;
  [_accessToken release];
  _accessToken = nil;
  [_expirationDate release];
  _expirationDate = nil;

  NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];
  NSArray* facebookCookies = [cookies cookiesForURL:[NSURL URLWithString:@"http://login.facebook.com"]];

  for (NSHTTPCookie* cookie in facebookCookies) {
    [cookies deleteCookie:cookie];
  }

  if ([self.sessionDelegate respondsToSelector:@selector(fbDidLogout)]) {
    [_sessionDelegate fbDidLogout];
  }
}

The facebook API does invalidate the access token and expirationdate variables and attempts to delete the mobile Safari cookies, but for some reason, probably Apple's fault the cookies are not really deleted. So when you attempt to login in the next time your mobile Safari will see the cookie and it says:

"You have already authorized .... Press "Okay" to continue. Logged in as ...."

Until either Facebook finds a fix or Apple fixes their broken API we must bypass SSO through Safari. Below are the changes I made to Facebook.m in order to force the old login dialog. If you used these changes they may not work forever but it is my guess that they will work for a very long time. Also to be sure this worked with the most recent facebook API I updated to the latest as of this post (Nov 2011 build).

Called from your code:

[facebook authorize:permissions];

Facebook API method:

- (void)authorize:(NSArray *)permissions {
  self.permissions = permissions;

//  [self authorizeWithFBAppAuth:YES safariAuth:YES];
    [self authorizeWithFBAppAuth:NO safariAuth:NO];
}

If this helps you please up rate this thread and my post to help others find it.

chandan
  • 2,453
  • 23
  • 31
  • To OP, atleast link your answer to the original person who wrote it. http://stackoverflow.com/a/8346319/1504996 – Steven Sep 21 '14 at 22:05