@@ -11,10 +11,12 @@ import { AuthenticationWWWAuthenticateRequest, ExtHostAuthenticationShape, ExtHo
1111import { IDialogService , IPromptButton } from '../../../platform/dialogs/common/dialogs.js' ;
1212import Severity from '../../../base/common/severity.js' ;
1313import { INotificationService } from '../../../platform/notification/common/notification.js' ;
14+ import { ActivationKind , IExtensionService } from '../../services/extensions/common/extensions.js' ;
1415import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js' ;
1516import { Emitter , Event } from '../../../base/common/event.js' ;
1617import { IAuthenticationAccessService } from '../../services/authentication/browser/authenticationAccessService.js' ;
1718import { IAuthenticationUsageService } from '../../services/authentication/browser/authenticationUsageService.js' ;
19+ import { getAuthenticationProviderActivationEvent } from '../../services/authentication/browser/authenticationService.js' ;
1820import { URI , UriComponents } from '../../../base/common/uri.js' ;
1921import { IOpenerService } from '../../../platform/opener/common/opener.js' ;
2022import { CancellationError } from '../../../base/common/errors.js' ;
@@ -116,6 +118,7 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
116118 @IAuthenticationUsageService private readonly authenticationUsageService : IAuthenticationUsageService ,
117119 @IDialogService private readonly dialogService : IDialogService ,
118120 @INotificationService private readonly notificationService : INotificationService ,
121+ @IExtensionService private readonly extensionService : IExtensionService ,
119122 @ITelemetryService private readonly telemetryService : ITelemetryService ,
120123 @IOpenerService private readonly openerService : IOpenerService ,
121124 @ILogService private readonly logService : ILogService ,
@@ -200,6 +203,12 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
200203 }
201204 }
202205
206+ async $ensureProvider ( id : string ) : Promise < void > {
207+ if ( ! this . authenticationService . isAuthenticationProviderRegistered ( id ) ) {
208+ return await this . extensionService . activateByEvent ( getAuthenticationProviderActivationEvent ( id ) , ActivationKind . Immediate ) ;
209+ }
210+ }
211+
203212 async $sendDidChangeSessions ( providerId : string , event : AuthenticationSessionsChangeEvent ) : Promise < void > {
204213 const obj = this . _registrations . get ( providerId ) ;
205214 if ( obj instanceof Emitter ) {
0 commit comments