Posts

Showing posts with the label Logout

ASP.NET Windows Authentication Logout

Answer : No server-side logout button will work when using "Windows" authentication. You must use "Forms" authentication if you want a logout button, or close the user's browser. For IE browsers only , you can use the following javascript to logout the user if using Windows Authentication. (Note: closing the browser isn't required, but recommended since the user might be using a non-IE browser). If the user clicks "No" to close the browser, then the user will be prompted for a username/password if they attempt to access a page on the site that requires authentication. try { document.execCommand("ClearAuthenticationCache"); } catch (e) { } window.close(); This code was taken from SharePoint's Signout.aspx page. Windows authentication works at the IIS level by passing your Windows authentication token. Since authentication occurs at the IIS level you cannot actually log out from application code. However, there seems t...

Best Practices For Storyboard Login Screen, Handling Clearing Of Data Upon Logout

Image
Answer : In your appDelegate.m inside your didFinishLaunchingWithOptions //authenticatedUser: check from NSUserDefaults User credential if its present then set your navigation flow accordingly if (authenticatedUser) { self.window.rootViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateInitialViewController]; } else { UIViewController* rootController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"LoginViewController"]; UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:rootController]; self.window.rootViewController = navigation; } In SignUpViewController.m file - (IBAction)actionSignup:(id)sender { AppDelegate *appDelegateTemp = [[UIApplication sharedApplication]delegate]; appDelegateTemp.window.rootViewController = [[UIStoryboard storyboardWithName:@...