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

Return refreshed Credentials in CredentialsManagerException to avoid logout #666

Merged
merged 3 commits into from
Jul 17, 2023

Conversation

poovamraj
Copy link
Contributor

Changes

To avoid Logout because of not storing the refreshed credentials. We are providing the Credentials back to the user through our Exception.

Since Exceptions are highly logged we are masking sensitive data from it to avoid exposing them.

References

#661

Testing

  • 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

@bennycao
Copy link
Contributor

Hi @poovamraj , just want to understand what it means by the comment here https://github.com/auth0/Auth0.Android/blob/main/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt#L191C51-L191C51

it says clearcredentials so hasValidCredentials returns a true value. Doesn't clearing credentials mean hasValidCredentials will return false. And does the retry statement mean retrying of saveCredentials or something else ? It would be good to understand what the comment is referring too, and not go down this path if re-saving refreshed credentials won't help

@poovamraj
Copy link
Contributor Author

@bennycao the comment is mentioned to note why we are calling the clearCredentials method. It is done so that hasValidCredentials won't return true when we can't fetch valid credentials due to corrupted keys.

@poovamraj poovamraj merged commit 81b516e into main Jul 17, 2023
6 checks passed
@poovamraj poovamraj deleted the return-renewed-credentials-even-in-exception branch July 17, 2023 15:54
@poovamraj poovamraj mentioned this pull request Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants