File tree Expand file tree Collapse file tree
extensions/microsoft-authentication/src
services/authentication/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -471,7 +471,10 @@ export class AzureActiveDirectoryService {
471471 redirect_uri : redirectUrl
472472 } ) ;
473473
474- const result = await fetch ( `${ loginEndpointUrl } ${ tenant } /oauth2/v2.0/token` , {
474+ const proxyEndpoints : { [ providerId : string ] : string } | undefined = await vscode . commands . executeCommand ( 'workbench.getCodeExchangeProxyEndpoints' ) ;
475+ const endpoint = proxyEndpoints && proxyEndpoints [ 'microsoft' ] || `${ loginEndpointUrl } ${ tenant } /oauth2/v2.0/token` ;
476+
477+ const result = await fetch ( endpoint , {
475478 method : 'POST' ,
476479 headers : {
477480 'Content-Type' : 'application/x-www-form-urlencoded' ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
1515import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
1616import { IActivityService , NumberBadge } from 'vs/workbench/services/activity/common/activity' ;
1717import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
18+ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService' ;
1819
1920export function getAuthenticationProviderActivationEvent ( id : string ) : string { return `onAuthenticationRequest${ id } ` ; }
2021
@@ -70,6 +71,11 @@ export interface SessionRequestInfo {
7071 [ scopes : string ] : SessionRequest ;
7172}
7273
74+ CommandsRegistry . registerCommand ( 'workbench.getCodeExchangeProxyEndpoints' , function ( accessor , _ ) {
75+ const environmentService = accessor . get ( IWorkbenchEnvironmentService ) ;
76+ return environmentService . options ?. codeExchangeProxyEndpoints ;
77+ } ) ;
78+
7379export class AuthenticationService extends Disposable implements IAuthenticationService {
7480 declare readonly _serviceBrand : undefined ;
7581 private _placeholderMenuItem : IDisposable | undefined ;
Original file line number Diff line number Diff line change @@ -345,6 +345,11 @@ interface IWorkbenchConstructionOptions {
345345 */
346346 readonly driver ?: boolean ;
347347
348+ /**
349+ * Endpoints to be used for proxying authentication code exchange calls in the browser.
350+ */
351+ readonly codeExchangeProxyEndpoints ?: { [ providerId : string ] : string }
352+
348353 //#endregion
349354}
350355
You can’t perform that action at this time.
0 commit comments