Using https://github.com/okta/okta-oidc-android okta lib to implement okta authentication on our android app. Recently sign in has started failing on few devices with “Keys are invalid” error. It seems the error is being thrown from DefaultEncryptionManager class of okta.
This happens when you reinstall or update the application. If it have lingering encrypted data from before. It can’t decrypt since it no longer have the valid keys. The best way to handle this is to catch the exception and clear data.