Ability to pass down WWW-Authenticate challenges down to Auth Providers (#261717)

* Initial plan

* Implement authentication challenges support for mandatory MFA

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>

* Add documentation and integration test for authentication challenges

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>

* Add validation script and finalize implementation

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>

* Update authentication challenges API to use AuthenticationConstraint interface

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>

* Get it compiling... who knows if it works

* New parseWWWAuthenticateHeader behavior

* works

* let's go with this for now

* Good shape

* bye

* final polish

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Tyler James Leonhardt
2025-08-14 18:10:05 -07:00
committed by GitHub
parent 36d72d9670
commit cf433b58e5
22 changed files with 703 additions and 120 deletions

View File

@@ -301,7 +301,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
})();
const authentication: typeof vscode.authentication = {
getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) {
getSession(providerId: string, scopesOrChallenge: readonly string[] | vscode.AuthenticationSessionRequest, options?: vscode.AuthenticationGetSessionOptions) {
if (!Array.isArray(scopesOrChallenge)) {
checkProposedApiEnabled(extension, 'authenticationChallenges');
}
if (
(typeof options?.forceNewSession === 'object' && options.forceNewSession.learnMore) ||
(typeof options?.createIfNone === 'object' && options.createIfNone.learnMore)
@@ -311,7 +314,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
if (options?.authorizationServer) {
checkProposedApiEnabled(extension, 'authIssuers');
}
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
return extHostAuthentication.getSession(extension, providerId, scopesOrChallenge, options as any);
},
getAccounts(providerId: string) {
return extHostAuthentication.getAccounts(providerId);