mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-18 15:55:59 +01:00
Introduce Issuer handling in the Authentication stack (#248948)
Mostly plumbing... this enables:
```
vscode.authentication.getSession('microsoft', scopes, { issuer: "https://login.microsoftonline.com/common/v2.0" });
```
And the respective API for an auth providers to handle it being passed in.
This props up work in MCP land which needs a way to map an issuer to an auth provider... but I certainly see utility outside of that space.
Fixes https://github.com/microsoft/vscode/issues/248775#issuecomment-2876711396
This commit is contained in:
committed by
GitHub
parent
1e03c9074c
commit
86efdcd2c1
@@ -298,6 +298,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
) {
|
||||
checkProposedApiEnabled(extension, 'authLearnMore');
|
||||
}
|
||||
if (options?.issuer) {
|
||||
checkProposedApiEnabled(extension, 'authIssuers');
|
||||
}
|
||||
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
|
||||
},
|
||||
getAccounts(providerId: string) {
|
||||
@@ -312,6 +315,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
return _asExtensionEvent(extHostAuthentication.getExtensionScopedSessionsEvent(extension.identifier.value));
|
||||
},
|
||||
registerAuthenticationProvider(id: string, label: string, provider: vscode.AuthenticationProvider, options?: vscode.AuthenticationProviderOptions): vscode.Disposable {
|
||||
if (options?.supportedIssuers) {
|
||||
checkProposedApiEnabled(extension, 'authIssuers');
|
||||
}
|
||||
return extHostAuthentication.registerAuthenticationProvider(id, label, provider, options);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user