diff --git a/webapp/packages/core-authentication/src/AuthProviderService.ts b/webapp/packages/core-authentication/src/AuthProviderService.ts index e82f8df034..657ad88dac 100644 --- a/webapp/packages/core-authentication/src/AuthProviderService.ts +++ b/webapp/packages/core-authentication/src/AuthProviderService.ts @@ -30,6 +30,7 @@ interface IServiceDescriptionLink extends IServiceDescriptionLinkOptions { export interface RequestedProvider { providerId: string; + configurationId?: string; } @injectable() @@ -56,8 +57,8 @@ export class AuthProviderService { }); } - async requireProvider(providerId: string): Promise { - const contexts = await this.requestAuthProvider.execute({ providerId }); + async requireProvider(providerId: string, configurationId?: string): Promise { + const contexts = await this.requestAuthProvider.execute({ providerId, configurationId }); const provider = contexts.getContext(AuthProviderContext); return provider.get(); diff --git a/webapp/packages/core-authentication/src/AuthProvidersResource.ts b/webapp/packages/core-authentication/src/AuthProvidersResource.ts index 9878ca4146..4317cdac8e 100644 --- a/webapp/packages/core-authentication/src/AuthProvidersResource.ts +++ b/webapp/packages/core-authentication/src/AuthProvidersResource.ts @@ -32,8 +32,7 @@ export class AuthProvidersResource extends CachedMapResource {}); - this.serverConfigResource.outdateResource(this); + this.sync(serverConfigResource, () => {}, () => CachedMapAllKey); this.authConfigurationsResource.onItemUpdate.addHandler(this.updateConfigurations.bind(this)); this.authConfigurationsResource.onItemDelete.addHandler(this.deleteConfigurations.bind(this)); diff --git a/webapp/packages/plugin-authentication/src/AuthenticationService.ts b/webapp/packages/plugin-authentication/src/AuthenticationService.ts index 36fe1685f9..2d82d7c90b 100644 --- a/webapp/packages/plugin-authentication/src/AuthenticationService.ts +++ b/webapp/packages/plugin-authentication/src/AuthenticationService.ts @@ -231,7 +231,7 @@ export class AuthenticationService extends Bootstrap { } if (!this.userInfoResource.hasToken(data.providerId)) { - await this.auth(false, { providerId: data.providerId }); + await this.auth(false, { providerId: data.providerId, configurationId: data.configurationId }); } if (this.userInfoResource.hasToken(data.providerId)) { diff --git a/webapp/packages/plugin-authentication/src/Dialog/useAuthDialogState.ts b/webapp/packages/plugin-authentication/src/Dialog/useAuthDialogState.ts index 64ff6e88ce..b4c892b82d 100644 --- a/webapp/packages/plugin-authentication/src/Dialog/useAuthDialogState.ts +++ b/webapp/packages/plugin-authentication/src/Dialog/useAuthDialogState.ts @@ -15,7 +15,6 @@ import { useResource, useObservableRef } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { CachedMapAllKey } from '@cloudbeaver/core-sdk'; -import type { ILoadableState } from '@cloudbeaver/core-utils'; import { FEDERATED_AUTH } from './FEDERATED_AUTH';