-
Notifications
You must be signed in to change notification settings - Fork 938
[PM-29885] Implement SSO cookie vending authentication flow #6522
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
base: main
Are you sure you want to change the base?
Conversation
|
New Issues (4)Checkmarx found the following issues in this Pull Request
|
...tlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt
Dismissed
Show dismissed
Hide dismissed
...tlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt
Dismissed
Show dismissed
Hide dismissed
...tlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt
Dismissed
Show dismissed
Hide dismissed
...tlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt
Dismissed
Show dismissed
Hide dismissed
|
Claude finished @SaintPatrck's task in 5m 56s ββ View job Code Review: PM-29885 SSO Cookie Vending Authentication Flow
Review complete. Inline comments have been posted on the PR for specific findings. Overall the implementation follows Bitwarden's architectural patterns well β proper interface/impl separation, clean UDF integration via |
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6522 +/- ##
==========================================
- Coverage 86.38% 86.31% -0.07%
==========================================
Files 777 797 +20
Lines 56175 56629 +454
Branches 8170 8192 +22
==========================================
+ Hits 48527 48882 +355
- Misses 4804 4895 +91
- Partials 2844 2852 +8 β View full report in Codecov by Sentry. π New features to boost your workflow:
|
Add cookie interceptor that manages ELB session cookies for enterprise SSO configurations. The interceptor attaches stored cookies to API requests, preempts requests when cookie bootstrap is needed, and detects HTTP 302 redirects to trigger cookie re-acquisition via an identity provider. Key components: - CookieInterceptor for OkHttp request/response cookie handling - NetworkCookieManager for bootstrap detection and cookie storage - CookieRedirectException to signal cookie acquisition flow - CookieProvider interface bridging network and app layers Co-Authored-By: Claude <[email protected]>
5087f55 to
0dc2bc5
Compare
This commit updates the `RetrofitsTest` to ensure that the `CookieInterceptor` is consistently called across all Retrofit client configurations. Previously, the tests for `api`, `identity`, `events`, and `notifications` clients did not verify the presence of the cookie interceptor. This change adds an assertion (`assertTrue(isCookieInterceptorCalled)`) to each relevant test case to confirm that the interceptor is included in the chain.
| ?.type | ||
| ?.let { bootstrapType -> | ||
| when { | ||
| bootstrapType == BOOTSTRAP_TYPE_SSO_COOKIE_VENDOR -> { |
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.
Can we make the bootstrapType the subject
| // Return the response if it is not a redirect or does not contain | ||
| // a Location header. | ||
| val location = response.header(HEADER_LOCATION) | ||
| if (response.code != HTTP_REDIRECT || location == null) { |
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.
Should this be an &&?


ποΈ Tracking
https://bitwarden.atlassian.net/browse/PM-29885
π Objective
Add cookie interceptor support for enterprise SSO configurations that require ELB session cookies. The interceptor manages the full cookie lifecycle for API requests behind a load balancer:
CookieheaderKey components:
CookieInterceptorβ OkHttp interceptor for request/response cookie handlingNetworkCookieManager/NetworkCookieManagerImplβ Bootstrap detection and cookie storage bridgeCookieRedirectExceptionβ Signal exception to trigger cookie acquisition flowCookieProviderβ Interface bridging the network and app layers