IOS – How do iOS apps from the same developer retain and access login information after being uninstalled without the use of iCloud


The following is a real-world example – I'm not an iOS developer, so I am trying to understand how this can be possible:

  1. Create a new, test Google account and when done, create a test Apple ID.

  2. Set up an iOS device, and at the stage where you are asked to enter the details to log into an Apple ID, choose to skip this for now.

  3. When taken to Springboard, launch the App Store, and search for "Assistant". Tap the "Get" button, at which time you will be asked to log into the iTunes Store. Do this by entering the details for the just-created Apple ID, at which point the app will begin to download. Note that we have in no way logged into iCloud, and that we have just logged into the iTunes store for the purpose of downloading the app.

  4. When the app has finished downloading, launch it and when asked to sign in, enter the details for the new Google account (created in step 1). You should now be signed into the Assistant app.

  5. Go back to the Home screen, and remove the Assistant app; confirm when prompted so that it will be removed from the device.

  6. Now, go back to the App Store, and search for "Gmail". Choose to download this – you shouldn't be prompted to log into an Apple ID, because iOS has saved the details when Assistant was downloaded.

  7. Launch the app, and tap the "Sign In" button. Notice that the previously-entered Google account is listed – this will match the one used to sign into Assistant. Tapping on this account will allow you to access Gmail with those details, without being prompted to enter a password of any kind whatsoever.

For me, the most interesting aspect of this is that even after the Assistant app is removed, the details for the Google account entered into the app before being uninstalled are still remembered. I haven't been able to figure out how this is done; it can't be iCloud (because it wasn't enabled at the time of the initial installation of Assistant). Does anybody know how it's possible that even after an app is uninstalled, another app is able to read data previously written to memory by a separate app?

Best Answer

The login information is securely store in the iOS keychain subsystem. Unlike macOS, keychain in iOS is not user accessible. However, apps can programmatically store and query for data in keychain.

Google developed apps look for pre-existing user information in the iOS keychain when installed. The login information is not removed from the device unless you choose to remove the account from your device from within one of the installed app.

iOS keychain provides a secure cryptographic disk store which is locked when the device is locked and unlocked when the device is unlocked. An app can access only its own keychain items, or those shared with a group to which the app belongs. Apps from the same developer, such as Google in this case, fall under same group (via common Bundle Identifier component) and this lets them share a secret via keychain.