5

I'm developing an internal app that will leverage our corporate Google Drive accounts and will be used on shared devices (iPads shared among teachers and students at school sites).

Is there a way to force GIDSignIn to require a password with each sign-in attempt? Right now, even after calling GIDSIgnIn.sharedInstance().signOut() (or GIDSignIn.sharedInstacne().disconnect()) the user doesn't need to enter their password the next time they access the app. That means, when the device is taken by the next user, they could very easily access the other user's account.

Am I missing something? Do I need to somehow clear the cookies store in the UIWebView that the GIDSignIn process uses?

jcaron
  • 16,631
  • 5
  • 29
  • 43
Greg
  • 193
  • 1
  • 12
  • 1
    hey Greg! did you find any solutions? I'm stuck too – tryKuldeepTanwar Jul 31 '18 at 09:27
  • 1
    Not really. Since the apps I develop are under the enterprise license, I have my user's log in the first time with Safari (in private mode) or on a PC and I store a server token for the user that I can then use for the APIs. That method wouldn't work for App Store apps though. – Greg Aug 05 '18 at 04:20

1 Answers1

5

Where available, the GIDSignIn login process uses a SFSafariViewController, not a UIWebView. It leverages the cookies (as well as passwords) stored in Safari, for a quicker login.

I don't think you would be able to clear such cookies. You should be able to force a Google log out, though, by opening https://www.google.com/accounts/Logout in an SFSafariViewController, though the interaction with the rest of your app may be a bit weird. See Logout link with return URL (OAuth) for a way to provide a return URL which you may try to use to control the process (you'll need to use an URL scheme to return, though).

Note that iOS may prompt to save login information, and then provide said login information to subsequent users. You'll need to disable that in Settings -> Safari -> AutoFill

There may be other ways of achieving it via configuration of the device, but iOS is not really designed for multiple users at the moment.

Community
  • 1
  • 1
jcaron
  • 16,631
  • 5
  • 29
  • 43