Fix Cloud Endpoints (#21805) (#21878)

* replace hardcoded endpoints

* cleanup
This commit is contained in:
Christopher Suh
2023-02-08 11:23:48 -08:00
committed by GitHub
parent a90591b881
commit 680d12163d
3 changed files with 5 additions and 5 deletions

View File

@@ -341,7 +341,7 @@ export abstract class AzureAuth implements vscode.Disposable {
// https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/3687 // https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/3687
const tokenRequest = { const tokenRequest = {
account: account, account: account,
authority: `https://login.microsoftonline.com/${tenantId}`, authority: `${this.loginEndpointUrl}${tenantId}`,
scopes: newScope, scopes: newScope,
forceRefresh: true forceRefresh: true
}; };
@@ -693,7 +693,7 @@ export abstract class AzureAuth implements vscode.Disposable {
let accountIssuer = 'unknown'; let accountIssuer = 'unknown';
if (tokenClaims.iss === 'https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/' || if (tokenClaims.iss === 'https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/' ||
tokenClaims.iss === 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0') { tokenClaims.iss === `${this.loginEndpointUrl}72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0`) {
accountIssuer = Constants.AccountIssuer.Corp; accountIssuer = Constants.AccountIssuer.Corp;
} }
if (tokenClaims?.idp === 'live.com') { if (tokenClaims?.idp === 'live.com') {

View File

@@ -233,7 +233,7 @@ export class AzureAuthCodeGrant extends AzureAuth {
codeChallenge: this.pkceCodes.codeChallenge, codeChallenge: this.pkceCodes.codeChallenge,
codeChallengeMethod: this.pkceCodes.challengeMethod, codeChallengeMethod: this.pkceCodes.challengeMethod,
prompt: Constants.SELECT_ACCOUNT, prompt: Constants.SELECT_ACCOUNT,
authority: `https://login.microsoftonline.com/${tenant.id}`, authority: `${this.loginEndpointUrl}${tenant.id}`,
state: state state: state
}; };
let authCodeRequest: AuthorizationCodeRequest; let authCodeRequest: AuthorizationCodeRequest;
@@ -241,7 +241,7 @@ export class AzureAuthCodeGrant extends AzureAuth {
scopes: this.scopes, scopes: this.scopes,
redirectUri: `${this.redirectUri}:${serverPort}/redirect`, redirectUri: `${this.redirectUri}:${serverPort}/redirect`,
codeVerifier: this.pkceCodes.codeVerifier, codeVerifier: this.pkceCodes.codeVerifier,
authority: `https://login.microsoftonline.com/${tenant.id}`, authority: `${this.loginEndpointUrl}${tenant.id}`,
code: '' code: ''
}; };
let authCodeUrl = await this.clientApplication.getAuthCodeUrl(authUrlRequest); let authCodeUrl = await this.clientApplication.getAuthCodeUrl(authUrlRequest);

View File

@@ -64,7 +64,7 @@ export class AzureDeviceCode extends AzureAuth {
const deviceCodeRequest: DeviceCodeRequest = { const deviceCodeRequest: DeviceCodeRequest = {
scopes: this.scopes, scopes: this.scopes,
authority: `https://login.microsoftonline.com/${tenant.id}`, authority: `${this.loginEndpointUrl}${tenant.id}`,
deviceCodeCallback: async (response) => { deviceCodeCallback: async (response) => {
await azdata.accounts.beginAutoOAuthDeviceCode(this.metadata.id, this.pageTitle, response.message, response.userCode, response.verificationUri); await azdata.accounts.beginAutoOAuthDeviceCode(this.metadata.id, this.pageTitle, response.message, response.userCode, response.verificationUri);
} }