Skip to content

[PM-41330] feat: Add custom header support for self-hosted environments - #7226

Open
jalenfran wants to merge 1 commit into
bitwarden:mainfrom
jalenfran:feat/self-hosted-custom-headers
Open

[PM-41330] feat: Add custom header support for self-hosted environments#7226
jalenfran wants to merge 1 commit into
bitwarden:mainfrom
jalenfran:feat/self-hosted-custom-headers

Conversation

@jalenfran

Copy link
Copy Markdown

🎟️ Tracking

Community feature request: Allow custom header for the Bitwarden mobile app (Android/iOS)

📔 Objective

Allow configuring custom HTTP headers on the pre-auth self-hosted environment screen, applied to
every request sent to the environment's hosts. This lets the app reach self-hosted servers behind
reverse proxies that gate access on a header — e.g. Cloudflare Access service tokens
(CF-Access-Client-Id / CF-Access-Client-Secret) — which currently block the mobile app even
though the web vault works via browser-based authentication.

  • Store header values in encrypted SharedPreferences; only an opaque identifier is persisted in
    EnvironmentUrlDataJson, mirroring keyUri
  • Inject headers via a network-level OkHttp interceptor scoped to the environment's hosts (scheme +
    host match), so credentials never reach third parties and never appear in the application-level
    debug HTTP logs
  • Apply headers to Glide icon requests, which bypass the Retrofit pipeline
  • Validate header names/values at save time so an invalid header can't silently break connectivity
  • Reference-count cleanup across accounts on logout and account deletion, and when the pre-auth
    environment is replaced (built-in region selection, MDM-managed URLs)
  • Redact Cookie and Set-Cookie values from the debug HTTP logs

📸 Screenshots

Custom headers section on the self-hosted environment screen

Allow configuring custom HTTP headers on the pre-auth self-hosted
environment screen, applied to every request sent to the environment's
hosts. Supports reverse proxies that gate access on a header, such as
Cloudflare Access.

- Store header values in encrypted SharedPreferences; only an opaque
  identifier is persisted in EnvironmentUrlDataJson, mirroring keyUri
- Inject headers via a network-level OkHttp interceptor scoped to the
  environment's hosts, so credentials never reach third parties and
  never appear in the application-level debug HTTP logs
- Apply headers to Glide icon requests, which bypass the Retrofit
  pipeline
- Reference-count cleanup across accounts on logout and account
  deletion, and when replacing the pre-auth environment with a
  built-in region
- Redact Cookie and Set-Cookie values from the debug HTTP logs
@jalenfran
jalenfran requested review from a team and david-livefront as code owners August 1, 2026 16:08
@bitwarden-bot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-41330
Link: https://bitwarden.atlassian.net/browse/PM-41330

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title feat: Add custom header support for self-hosted environments [PM-41330] feat: Add custom header support for self-hosted environments Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants