Patch Key alias migration for Secure Credentials Manager #325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
We recently shipped a change that affected how the generated KeyStore keys were stored to avoid collisions with other Auth0 enabled android apps. The anticipated impact was that the end-users would be required to log in back again since existing keys under the old alias would not be found.
The
hasValidCredentials
method however, was not aware of this key alias change being introduced and so, was still reporting "valid credentials" for the old alias, making the call togetCredentials()
fail passing the exception in the error callback.This PR attempts to fix that by storing the key alias string that is used when saving the credentials, and adding that check when calling
hasValidCredentials()
.References
Testing
I've added some tests for migration scenarios (e.g. key not set / key set with a value different than expected)
This change adds unit test coverage
This change adds integration test coverage
This change has been tested on the latest version of the platform/language or why not
Checklist
I have read the Auth0 general contribution guidelines
I have read the Auth0 Code of Conduct
All existing and new tests complete without errors