[PR #6522] [PM-29885] Implement SSO cookie vending authentication flow #12786

Closed
opened 2026-04-11 03:51:15 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6522

State: closed
Merged: Yes


🎟️ 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:

  • Preemptive bootstrap: Detects when cookies are needed but not yet available and triggers acquisition before making a doomed request
  • Cookie attachment: Attaches stored cookies to outgoing API requests via the Cookie header
  • Redirect detection: Catches HTTP 302 responses indicating expired/missing cookies and triggers re-acquisition via the identity provider
  • Connection safety: Properly closes OkHttp responses before throwing to prevent connection pool exhaustion

Key components:

  • CookieInterceptor — OkHttp interceptor for request/response cookie handling
  • NetworkCookieManager / NetworkCookieManagerImpl — Bootstrap detection and cookie storage bridge
  • CookieRedirectException — Signal exception to trigger cookie acquisition flow
  • CookieProvider — Interface bridging the network and app layers
**Original Pull Request:** https://github.com/bitwarden/android/pull/6522 **State:** closed **Merged:** Yes --- ## 🎟️ 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: - **Preemptive bootstrap**: Detects when cookies are needed but not yet available and triggers acquisition before making a doomed request - **Cookie attachment**: Attaches stored cookies to outgoing API requests via the `Cookie` header - **Redirect detection**: Catches HTTP 302 responses indicating expired/missing cookies and triggers re-acquisition via the identity provider - **Connection safety**: Properly closes OkHttp responses before throwing to prevent connection pool exhaustion Key components: - `CookieInterceptor` — OkHttp interceptor for request/response cookie handling - `NetworkCookieManager` / `NetworkCookieManagerImpl` — Bootstrap detection and cookie storage bridge - `CookieRedirectException` — Signal exception to trigger cookie acquisition flow - `CookieProvider` — Interface bridging the network and app layers
GiteaMirror added the pull-request label 2026-04-11 03:51:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#12786