My application supports login with facebook, but when I log out and log in again I am not asked for any credentials – it immediately logs in with the username which goes native in iOS6. I want something like in native facebook application:

When clicking “not you” facebook offers new login screen.
I followed this tutorial
The problem seems to be somewhere here:
- (void)openSession
{
NSArray *permissions=[NSArray arrayWithObjects: @"publish_stream", @"publish_actions",@"create_event", nil];
// [FBSession open]
[FBSession openActiveSessionWithPublishPermissions:permissions
defaultAudience:FBSessionDefaultAudienceEveryone
allowLoginUI:YES
completionHandler:
^(FBSession *session,
FBSessionState state, NSError *error) {
[self sessionStateChanged:session state:state error:error];
}];
}
- (void)sessionStateChanged:(FBSession *)session
state:(FBSessionState) state
error:(NSError *)error
{
switch (state) {
case FBSessionStateOpen: {
NSLog(@"Sesstion opened");
UIViewController *topViewController =
[self.navController topViewController];
NSLog(@"Class: %@", [[topViewController presentedViewController] class]);
if ([[topViewController presentedViewController]
isKindOfClass:[LoginViewController class]])
{
[topViewController dismissViewControllerAnimated:YES completion:nil];
}
ViewController *basic=(ViewController*)topViewController;
NSLog(@"Populating details");
[basic populateUserDetails];
}
break;
case FBSessionStateClosed:
{
NSLog(@"Session closed");
[FBSession.activeSession closeAndClearTokenInformation];
}
case FBSessionStateClosedLoginFailed:
NSLog(@"Login failed");
[self.navController popToRootViewControllerAnimated:NO];
[FBSession.activeSession closeAndClearTokenInformation];
[self showLoginView];
break;
default:
break;
}
if (error) {
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Error"
message:error.localizedDescription
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
}
I am not sure the Facebook SDK supports that – although I might be wrong. The idea (as I understand it) is that Facebook login allows the currently logged in Facebook user to login to your app. If no one is logged in to Facebook, the credentials page will be shown. After providing valid credentials, the user will be logged in to Facebook and an auth_token is sent to your app.
The point is that you can’t authenticate a different user than the one currently logged in to Facebook. That would first require a logout of the current user and I think Facebook wish to keep this “change user” functionality to the Facebook app.
Also, note that when logging out from your app, the user stays logged in to Facebook. This is different from the policy that applies to web sites that use Facebook authentication. In that case, the user should be logged out both from the site and from Facebook.