mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-13 15:35:20 +01:00
Remove old client id versioning code (#242760)
We're not doing this anymore and our default client id will be "upgraded" by the identity team.
This commit is contained in:
committed by
GitHub
parent
eab6f90c72
commit
14324bbbc2
@@ -115,23 +115,6 @@
|
||||
"tags": [
|
||||
"onExP"
|
||||
]
|
||||
},
|
||||
"microsoft-authentication.clientIdVersion": {
|
||||
"type": "string",
|
||||
"default": "v1",
|
||||
"enum": [
|
||||
"v2",
|
||||
"v1"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"%microsoft-authentication.clientIdVersion.enumDescriptions.v2%",
|
||||
"%microsoft-authentication.clientIdVersion.enumDescriptions.v1%"
|
||||
],
|
||||
"markdownDescription": "%microsoft-authentication.clientIdVersion.description%",
|
||||
"tags": [
|
||||
"onExP",
|
||||
"experimental"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
},
|
||||
"microsoft-authentication.implementation.enumDescriptions.msal": "Use the Microsoft Authentication Library (MSAL) to sign in with a Microsoft account.",
|
||||
"microsoft-authentication.implementation.enumDescriptions.classic": "(deprecated) Use the classic authentication flow to sign in with a Microsoft account.",
|
||||
"microsoft-authentication.clientIdVersion.description": "The version of the Microsoft Account client ID to use for signing in with a Microsoft account. Only change this if you have been asked to. The default is `v1`.",
|
||||
"microsoft-authentication.clientIdVersion.enumDescriptions.v1": "Use the v1 Microsoft Account client ID to sign in with a Microsoft account.",
|
||||
"microsoft-authentication.clientIdVersion.enumDescriptions.v2": "Use the v2 Microsoft Account client ID to sign in with a Microsoft account.",
|
||||
"microsoft-sovereign-cloud.environment.description": {
|
||||
"message": "The Sovereign Cloud to use for authentication. If you select `custom`, you must also set the `#microsoft-sovereign-cloud.customEnvironment#` setting.",
|
||||
"comment": [
|
||||
|
||||
@@ -3,21 +3,13 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { workspace } from 'vscode';
|
||||
|
||||
const DEFAULT_CLIENT_ID_V1 = 'aebc6443-996d-45c2-90f0-388ff96faa56';
|
||||
const DEFAULT_TENANT_V1 = 'organizations';
|
||||
const DEFAULT_CLIENT_ID_V2 = 'c27c220f-ce2f-4904-927d-333864217eeb';
|
||||
const DEFAULT_TENANT_V2 = 'common';
|
||||
const DEFAULT_CLIENT_ID = 'aebc6443-996d-45c2-90f0-388ff96faa56';
|
||||
const DEFAULT_TENANT = 'organizations';
|
||||
|
||||
const OIDC_SCOPES = ['openid', 'email', 'profile', 'offline_access'];
|
||||
const GRAPH_TACK_ON_SCOPE = 'User.Read';
|
||||
|
||||
export class ScopeData {
|
||||
|
||||
private readonly _defaultClientId: string;
|
||||
private readonly _defaultTenant: string;
|
||||
|
||||
/**
|
||||
* The full list of scopes including:
|
||||
* * the original scopes passed to the constructor
|
||||
@@ -52,14 +44,6 @@ export class ScopeData {
|
||||
readonly tenantId: string | undefined;
|
||||
|
||||
constructor(readonly originalScopes: readonly string[] = []) {
|
||||
if (workspace.getConfiguration('microsoft-authentication').get<'v1' | 'v2'>('clientIdVersion') === 'v2') {
|
||||
this._defaultClientId = DEFAULT_CLIENT_ID_V2;
|
||||
this._defaultTenant = DEFAULT_TENANT_V2;
|
||||
} else {
|
||||
this._defaultClientId = DEFAULT_CLIENT_ID_V1;
|
||||
this._defaultTenant = DEFAULT_TENANT_V1;
|
||||
}
|
||||
|
||||
const modifiedScopes = [...originalScopes];
|
||||
modifiedScopes.sort();
|
||||
this.allScopes = modifiedScopes;
|
||||
@@ -67,7 +51,7 @@ export class ScopeData {
|
||||
this.scopesToSend = this.getScopesToSend(modifiedScopes);
|
||||
this.clientId = this.getClientId(this.allScopes);
|
||||
this.tenantId = this.getTenantId(this.allScopes);
|
||||
this.tenant = this.tenantId ?? this._defaultTenant;
|
||||
this.tenant = this.tenantId ?? DEFAULT_TENANT;
|
||||
}
|
||||
|
||||
private getClientId(scopes: string[]) {
|
||||
@@ -76,7 +60,7 @@ export class ScopeData {
|
||||
return current.split('VSCODE_CLIENT_ID:')[1];
|
||||
}
|
||||
return prev;
|
||||
}, undefined) ?? this._defaultClientId;
|
||||
}, undefined) ?? DEFAULT_CLIENT_ID;
|
||||
}
|
||||
|
||||
private getTenantId(scopes: string[]) {
|
||||
|
||||
Reference in New Issue
Block a user