Skip to content

Commit 63e8d98

Browse files
committed
Fix basic WWW-Authenticate header issue
1 parent 9a33692 commit 63e8d98

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/vscode-docker-registries/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.4.2 - 16 April 2026
22
### Fixed
33
* Fixed an issue where some requests would fail. [#354](https://github.com/microsoft/vscode-docker-extensibility/issues/354)
4+
* Fixed incorrect handling of basic auth `WWW-Authenticate` headers. [#355](https://github.com/microsoft/vscode-docker-extensibility/issues/355)
45

56
## 0.4.1 - 14 October 2025
67
### Fixed

packages/vscode-docker-registries/src/auth/BasicOAuthProvider.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@ export class BasicOAuthProvider extends BasicAuthProvider implements Authenticat
7474

7575
const match = wwwAuthenticateHeaderRegex.exec(wwwAuthenticateHeader);
7676

77-
if (!match?.groups?.realm || !match?.groups?.service || !match?.groups?.scope) {
77+
if (match?.groups?.realm && match?.groups?.service && match?.groups?.scope) {
78+
this.oAuthEndpoint = match.groups.realm;
79+
this.oAuthService = match.groups.service;
80+
this.defaultScopes = match.groups.scope.split(' ');
81+
} else if (!/Basic\s+/i.test(wwwAuthenticateHeader)) {
7882
throw new Error(vscode.l10n.t('Unable to parse WWW-Authenticate header: "{0}"', wwwAuthenticateHeader));
7983
}
84+
// For Basic challenges, oAuthEndpoint/oAuthService remain undefined,
85+
// so getSession will use Basic auth directly.
8086

81-
this.oAuthEndpoint = match.groups.realm;
82-
this.oAuthService = match.groups.service;
83-
this.defaultScopes = match.groups.scope.split(' ');
8487
this._didFallback = true;
8588
}
8689

0 commit comments

Comments
 (0)