Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of a unique keystore key alias across apps #315

Merged
merged 1 commit into from
Jul 8, 2020

Conversation

lbalmaceda
Copy link
Contributor

@lbalmaceda lbalmaceda commented Jul 7, 2020

Changes

The intention is to use the App's Package Name from the Context vs the library's Application ID from the BuildConfig, to generate a key alias that is unique across app installs. This should prevent errors where apps using this very same library (or sharing the key alias) would have their keys collide.

Note

Since the key alias is changing with this PR, when you update to this last version of the SDK, any existing key will not be found and it will act as if the user was logged out. Double-check that you are not ignoring the exceptions thrown when the credential manager methods are being used. See our docs for more information.

References

Closes #309

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. Since this library has unit testing, tests should be added for new functionality and existing tests should complete without errors.

  • 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

@lbalmaceda lbalmaceda added CH: Fixed small Small review labels Jul 7, 2020
@lbalmaceda lbalmaceda added this to the v1-Next milestone Jul 7, 2020
@lbalmaceda lbalmaceda requested a review from a team July 7, 2020 17:56
@lbalmaceda lbalmaceda merged commit e40ec6b into master Jul 8, 2020
@lbalmaceda lbalmaceda deleted the unique-key-alias branch July 8, 2020 19:17
@lbalmaceda lbalmaceda modified the milestones: v1-Next, 1.24.0 Jul 16, 2020
@FilipKastrupGP
Copy link

How would I migrate from 1.23.0 to 1.24.0 without logging the user out?

@lbalmaceda
Copy link
Contributor Author

@FilipKastrupGP When you migrate, logged in users will be logged out. You should be first checking if credentials are available calling the hasCredentials method. Depending on its result, you'd be prompting the user to log in and saving the new credentials, or getting the ones stored from the manager. Always checking for any exception that might be raised in the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed small Small review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE in SecureCredentialsManager.getCredentials
4 participants