-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Auth - PM-7392 & PM-7436 - Token Service - Desktop - Add disk fallback for secure storage failures #8913
Auth - PM-7392 & PM-7436 - Token Service - Desktop - Add disk fallback for secure storage failures #8913
Conversation
…g is an enc string.
…s token to improve handling around the access token encryption.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8913 +/- ##
==========================================
- Coverage 28.18% 28.08% -0.10%
==========================================
Files 2397 2422 +25
Lines 70642 71347 +705
Branches 13203 13321 +118
==========================================
+ Hits 19910 20038 +128
- Misses 49172 49738 +566
- Partials 1560 1571 +11 ☔ View full report in Codecov by Sentry. |
New Issues
Fixed Issues
|
… functional besides weird logout behavior.
… refresh token migrated flag.
…zedEncString static method.
…rvice-add-secure-storage-fallback + main.ts merge conflict resolution
… of https://github.com/bitwarden/clients into auth/pm-7392/token-service-add-secure-storage-fallback
…ince it isn't really visible on desktop or browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vault change looks good!
895c825
Type of change
Objective
To resolve PM-7392 (intermittent secure storage failures on Windows 10/11) and PM-7436 (some Linux distros do not have a secure storage provider configured so storing the access token encryption key / refresh token fails). This changeset should handle both scenarios and fallback to disk if the error is caught on initial set. If the error is caught on data retrieval after update, we will log the user out, and upon a subsequent login, the users should be able to login and have the set fallback to disk properly.
Code changes
Core
TokenService
changesundefined
w/null
Dependency Updates
StateService
reference so we could fix desktopmain.ts
circular dependency issueMessagingService
on theTokenService
.MessagingService
to theTokenService
.MessagingService
to theTokenService
.MessagingService
to theTokenService
.EncString
improvementsisSerializedEncString
- Add null checksparseEncryptedString
- Add better handling for scenarios discovered when passing in a valid JWT access token that isn't a valid encrypted stringisSerializedEncString
scenariosScreenshots
Logs the user out if the access token cannot be decrypted due to either the access token key not coming out of secure storage properly or secure storage not being configured
PM-7392.-.TokenSvc.Secure.Storage.Disk.Fallback.-.logs.the.user.out.if.the.access.token.cannot.be.decrypted.v2.mov
Falls back to disk if we fail to set the access token key into secure storage or if it can't be read back out
PM-7392.-.TokenSvc.Secure.Storage.Disk.Fallback.-.works.for.access.token.if.it.fails.to.set.in.secure.storage.mov
Falls back to disk properly if we fail to set the refresh token for whatever reason in secure storage or if it fails to be read back out immediately
PM-7392.-.TokenSvc.Secure.Storage.Disk.Fallback.-.works.for.refresh.token.if.it.fails.to.set.in.secure.storage.mov
Before you submit