# Restoring HTTP Basic Auth Autofill in the Bitwarden Extension: Vaultwarden and Chromium Troubleshooting


When accessing a website protected by HTTP Basic or Digest Authentication (such as router dashboards or private services behind htaccess), the browser displays a native authentication dialog, but the Bitwarden extension does not respond. Manually clicking the item in the extension popup results in an error: `Unable to autofill the selected item on this page. Copy and paste the information instead.`.

### Why Did Autofill Stop Working?

Native authentication prompts are not part of the page DOM. Browser extensions cannot inject content scripts to simulate keystrokes and must rely on underlying network APIs (`chrome.webRequest.onAuthRequired`). Upon receiving a 401 response from the server, the extension background silently supplies matching credentials from the vault to the browser to complete authentication.

This mechanism had two breaking points:

1. **Disabled by default upstream**: In earlier versions, as long as a single credential strictly matched the request URI, the extension would automatically send credentials in the background. This often caused standard website login credentials to be sent as Basic Auth credentials (Issue [#11250](https://github.com/bitwarden/clients/issues/11250)), leading to failed logins and credential leakage. Bitwarden merged PR [#22612](https://github.com/bitwarden/clients/pull/22612) in version 2026.9, gating the listener behind the client feature flag `enable-basic-auth-response` (disabled by default), and Bitwarden's official cloud servers do not expose an option to enable it.
2. **Missing fallback in privacy-focused Chromium forks**: In standard Google Chrome or Microsoft Edge, even if a third-party extension fails, the browser's built-in password manager still prompts whether to save and fill credentials. However, privacy-oriented browsers like Helium intentionally disable Chromium's built-in password manager via mandatory policy (`kPasswordManagerEnabled=false`). Once the extension stops responding, there is no browser-level fallback.

Official cloud users currently must copy and paste credentials manually. On self-hosted Vaultwarden instances, this capability can be restored by dispatching the client feature flag, but several configuration details require attention.

### 1. Server Requirements and Configuration

#### Version must be >= 1.37.4
Vaultwarden only dispatches feature flags that are explicitly registered in its internal whitelist; unrecognized flags are stripped. Support for `enable-basic-auth-response` was added to the whitelist in Vaultwarden 1.37.4 (PR [#7745](https://github.com/dani-garcia/vaultwarden/pull/7745)). On earlier versions, even if the environment variable is supplied, the server discards it as an invalid flag.

#### Cannot be modified via /admin
In Vaultwarden's source code, `experimental_client_feature_flags` is marked with `is_editable: false` and appears only as read-only configuration in the admin panel. If manually appended to `data/config.json`, the entry will be discarded and overwritten the next time any setting is saved in the web admin interface.

The proper approach is injecting it as an environment variable in the container or Quadlet configuration:

```ini
# Quadlet [.container] section or Docker environment variable
Environment=EXPERIMENTAL_CLIENT_FEATURE_FLAGS=enable-basic-auth-response
```

After restarting the Vaultwarden service, verify the server response using the public endpoint:

```bash
curl -s https://vault.example.com/api/config | grep "enable-basic-auth-response"
```

If the output contains `"enable-basic-auth-response": true`, the server is successfully delivering the flag.

### 2. Extension Local Cache and Restart Behavior

After enabling the setting on the server, reloading the webpage often still fails to autofill due to two client-side behaviors:

1. **Client-side 1-hour cache**: The Bitwarden extension's configuration sync logic (`default-config.service.ts`) enforces a 1-hour local cache TTL (`RETRIEVAL_INTERVAL = 3_600_000`). Before this cache expires, refreshing pages or restarting the browser will not query the server for updated flags.
2. **Listener only registered on bootstrap**: The Basic Auth listener logic (`web-request.background.ts`) checks the feature flag once during background service worker startup (`bootstrap()`). If the flag evaluated to `false` at startup, registration is skipped entirely. Even if updated configuration is retrieved later, an active service worker will not dynamically register the missing listener.

To apply the change, the full extension lifecycle must be refreshed:

**Step A: Clear extension cache**  
Navigate to the extensions manager (`chrome://extensions` or `helium://extensions`), turn on "Developer mode", click "Service worker" under Bitwarden to open DevTools, and run the following in the console:

```javascript
chrome.storage.local.get(null).then(o => {
  const keys = Object.keys(o).filter(k => /config_serverConfig/i.test(k));
  chrome.storage.local.remove(keys);
});
```
*Note: Logging out and logging back in also purges this cache.*

**Step B: Reload the extension**  
In the extension management page, click the reload button on the Bitwarden card (or toggle it off and on) to force the service worker through a complete re-initialization.

**Step C: Verify listener readiness**  
Open the service worker console again and confirm that the listener is attached:

```javascript
chrome.webRequest.onAuthRequired.hasListeners()
```

If it returns `true`, the background listener is active and running.

### 3. Matching Conditions for Autofill

Once the listener is active, the extension will only supply credentials silently if all of the following conditions are met (failing any condition leaves the prompt to the browser):

- **The vault is unlocked** (locked vaults never respond);
- **Exactly one matching login**: The vault contains **exactly 1** login item matching the request host (multiple matches abort autofill to prevent wrong credential submission);
- **Top-level page navigation only**: The challenge must originate from a top-level page navigation (subresources, XHR/fetch, and iframes are ignored);
- **Auth scheme is basic or digest** (ntlm and negotiate schemes are excluded);
- **Not a proxy challenge**: 407 proxy authentication challenges are ignored.

### Security Note

This mechanism was disabled upstream because automatic credential dispatch carries security risks (such as malicious sites triggering requests to protected paths within the same domain to silently collect credentials). When enabling this flag in a self-hosted environment, configure restrictive URI match detection (such as "Host" or "Exact") on sensitive vault items to avoid unintended matches.


---

> Author: Nite  
> URL: https://www.nite07.com/en/posts/vaultwarden-bitwarden-basic-auth/  

