You need to sign in to do that
Don't have an account?
John T.
logout from Oauth
Hi Guys,
When I try to logout from my IOS app it redirects me to the OAUTH screen which asks permission. I wanted to return to the login screen of Oauth. Is there a way I can do that?
It sounds like the WebView is remember the user's session. You might try redirecting the view to logout.jsp first, which I think should clear out the related cookies.
try this
[[[SFRestAPIsharedInstance] coordinator] revokeAuthentication];
[[[SFRestAPIsharedInstance] coordinator] authenticate];
2013-09-27 11:12:00.301 CareWeb[21446:c07] oauthCoordinator:didBeginAuthenticationWithView
2013-09-27 11:12:00.302 CareWeb[21446:c07] Warning: Attempt to present <SFAuthorizingViewController: 0x8451c50> on <SFNativeRootViewController: 0x82315b0> whose view is not in the window hierarchy!
This solution was working with the 1.2 or less of the mobile sdk. If you are using a new one, try posting the question to the github page where they can help you.
cheers
https://github.com/forcedotcom/SalesforceMobileSDK-iOS try posting there your question, never the less they might tell you to upgrade to 2.0 , but give it a try.
On the other hand i used that code in one of my project using 1.1 and 1.2 , but it was just for testing. I usually tell the users to go to Settings-> Images for Salesforce-> Logout- ON.
But i have instantiated the storyboard from app delegate once the user does the authentication using following method
- (UIViewController*)newRootViewController {
[self addDeviceTokenToChatter];
[self getTheUcsfUserId];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UINavigationController * myStoryBoardInitialViewController = [sb instantiateInitialViewController];
return myStoryBoardInitialViewController;
}
Now i have tried logging out using the following function
-(void)logoutofTheApp
{
[[[SFRestAPI sharedInstance] coordinator] revokeAuthentication];
[[[SFRestAPI sharedInstance] coordinator] authenticate];
// [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]];
}
i get this message
"view is not in the window hierarchy! "