mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00: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
@@ -17,6 +17,9 @@
|
||||
"ui",
|
||||
"workspace"
|
||||
],
|
||||
"enabledApiProposals": [
|
||||
"authIssuers"
|
||||
],
|
||||
"activationEvents": [],
|
||||
"capabilities": {
|
||||
"virtualWorkspaces": true,
|
||||
@@ -31,11 +34,17 @@
|
||||
"authentication": [
|
||||
{
|
||||
"label": "GitHub",
|
||||
"id": "github"
|
||||
"id": "github",
|
||||
"issuerGlobs": [
|
||||
"https://github.com/login/oauth"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "GitHub Enterprise Server",
|
||||
"id": "github-enterprise"
|
||||
"id": "github-enterprise",
|
||||
"issuerGlobs": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"configuration": [{
|
||||
|
||||
@@ -137,7 +137,17 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
|
||||
|
||||
this._disposable = vscode.Disposable.from(
|
||||
this._telemetryReporter,
|
||||
vscode.authentication.registerAuthenticationProvider(type, this._githubServer.friendlyName, this, { supportsMultipleAccounts: true }),
|
||||
vscode.authentication.registerAuthenticationProvider(
|
||||
type,
|
||||
this._githubServer.friendlyName,
|
||||
this,
|
||||
{
|
||||
supportsMultipleAccounts: true,
|
||||
supportedIssuers: [
|
||||
ghesUri ?? vscode.Uri.parse('https://github.com/login/oauth')
|
||||
]
|
||||
}
|
||||
),
|
||||
this.context.secrets.onDidChange(() => this.checkForUpdates())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"../../src/vscode-dts/vscode.d.ts"
|
||||
"../../src/vscode-dts/vscode.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.authIssuers.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user