Yes, I too was surprised to find an app where, despite the warning when deleting the app that all data would be deleted too, a reinstall retains all account information and data. The app I encountered does not use iCloud at all. I’m guessing it stores an identifying token in the device keychain and uses that token to retrieve data from a server.
According to Apple Developer Technical Support person ‘Quinn “The Eskimo!”’ on the Apple Developer Forums,
For now, it seems that completely wiping your device before re-installing apps is the only practical way to go. And don’t restore from a backup after wiping either, as the backup could contain the old keychain data.
To quote some of the details Quinn ‘The Eskimo’ gave:
First, a timeline:
- All versions of iOS prior to 10.3 beta preserve keychain items when an app is deleted.
IMPORTANT This was most definitely an implementation detail of the original iOS keychain. Our keychain documentation has never specified what would happen in this case.
10.3 beta included a change that deleted such items.
That caused compatibility problems (apps were relying on the existing behaviour, even though it wasn’t documented), so it was rolled back before 10.3 GM.
iOS 11 introduced the DeviceCheck framework, which provides a forward path for one of the most common legitimate use cases of this behaviour. For more info on this, see WWDC 2017 Session 702 Privacy and Your Apps.
Second, preserving keychain items on delete is an obvious privacy concern. As far as I know Apple has not made any specific announcements as to how we intend to resolve this issue (1). However, I don’t think it would surprise anyone if the 10.3 behaviour returned at some point in the future. I would hope that we’d be more proactive about announcing such a change -- for example, talking about it at WWDC -- but, as always, I can’t make any promises about The Future™.
See the article https://support.apple.com/en-in/HT202755
you don't need to open keychain access ( right click on login and click on delete references , this will delete the passwords in it , you can create a new keychain , but you don't want to loose the passwords , so resting keychain is use an iPhone and Mac , sign with same Apple ID and password on both and then reset the iCloud Keychain also don't click on reset iCloud Keychain ( it will remove the passwords stored in iCloud ) further consult apple support https://support.apple.com/en-in/HT201232