diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebAuthInfo.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebAuthInfo.java index a651608295..7fda561baf 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebAuthInfo.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebAuthInfo.java @@ -19,7 +19,6 @@ package io.cloudbeaver.model.session; import io.cloudbeaver.DBWUserIdentity; import io.cloudbeaver.model.user.WebUser; import io.cloudbeaver.model.user.WebUserOriginInfo; -import io.cloudbeaver.registry.WebAuthProviderConfiguration; import io.cloudbeaver.registry.WebAuthProviderDescriptor; import org.jkiss.code.NotNull; import org.jkiss.dbeaver.Log; @@ -41,7 +40,7 @@ public class WebAuthInfo implements SMSessionPrincipal { private final WebSession session; private final WebUser user; private final WebAuthProviderDescriptor authProvider; - private WebAuthProviderConfiguration authProviderConfiguration; + private String authProviderConfigurationId; private SMSession authSession; private final OffsetDateTime loginTime; private final DBWUserIdentity userIdentity; @@ -101,7 +100,11 @@ public class WebAuthInfo implements SMSessionPrincipal { @Property public String getAuthConfiguration() { - return authProviderConfiguration == null ? null : authProviderConfiguration.getId(); + return authProviderConfigurationId; + } + + public void setAuthProviderConfigurationId(String authProviderConfigurationId) { + this.authProviderConfigurationId = authProviderConfigurationId; } public WebUser getUser() { @@ -116,14 +119,6 @@ public class WebAuthInfo implements SMSessionPrincipal { return authProvider; } - public WebAuthProviderConfiguration getAuthProviderConfiguration() { - return authProviderConfiguration; - } - - public void setAuthProviderConfiguration(WebAuthProviderConfiguration authProviderConfiguration) { - this.authProviderConfiguration = authProviderConfiguration; - } - public SMSession getAuthSession() { return authSession; } diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionAuthProcessor.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionAuthProcessor.java index 849b304422..2878925b5d 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionAuthProcessor.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionAuthProcessor.java @@ -29,6 +29,7 @@ import io.cloudbeaver.utils.WebAppUtils; import org.jkiss.code.NotNull; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.Log; +import org.jkiss.dbeaver.model.auth.SMAuthConfigurationReference; import org.jkiss.dbeaver.model.auth.SMAuthInfo; import org.jkiss.dbeaver.model.auth.SMAuthProvider; import org.jkiss.dbeaver.model.auth.SMSession; @@ -87,8 +88,8 @@ public class WebSessionAuthProcessor { try { if (configMode && alreadyLoggedIn) { - for (String providerId : authInfo.getAuthData().keySet()) { - webSession.removeAuthInfo(providerId); + for (SMAuthConfigurationReference authConfiguration : authInfo.getAuthData().keySet()) { + webSession.removeAuthInfo(authConfiguration.getAuthProviderId()); } } webSession.updateSMAuthInfo(authInfo); @@ -102,8 +103,9 @@ public class WebSessionAuthProcessor { var securityController = webSession.getSecurityController(); Map providerConfig = Collections.emptyMap(); var newAuthInfos = new ArrayList(); - for (Map.Entry entry : authInfo.getAuthData().entrySet()) { - String providerId = entry.getKey(); + for (Map.Entry entry : authInfo.getAuthData().entrySet()) { + SMAuthConfigurationReference authConfiguration = entry.getKey(); + String providerId = authConfiguration.getAuthProviderId(); Map authAttrs = (Map) entry.getValue(); var authProviderDescriptor = getAuthProvider(providerId); @@ -111,15 +113,13 @@ public class WebSessionAuthProcessor { SMAuthProviderExternal authProviderExternal = authProviderInstance instanceof SMAuthProviderExternal ? (SMAuthProviderExternal) authProviderInstance : null; - boolean providerEnabled = isProviderEnabled(providerId); + boolean providerDisabled = !isProviderEnabled(providerId); if (configMode || webSession.hasPermission(DBWConstants.PERMISSION_ADMIN)) { // 1. Admin can authorize in any providers // 2. When it authorizes in non-local provider for the first time we force linkUser flag - if (!providerEnabled && webSession.getUser() != null) { + if (providerDisabled && webSession.getUser() != null) { linkWithActiveUser = true; } - } else if (!providerEnabled && !webSession.hasPermission(DBWConstants.PERMISSION_ADMIN)) { - throw new DBWebException("Authentication provider '" + providerId + "' is disabled"); } SMSession authSession; @@ -174,7 +174,9 @@ public class WebSessionAuthProcessor { authProviderDescriptor, userIdentity, authSession, - OffsetDateTime.now()); + OffsetDateTime.now() + ); + webAuthInfo.setAuthProviderConfigurationId(authConfiguration.getAuthProviderConfigurationId()); webAuthInfo.setMessage("Authenticated with " + authProviderDescriptor.getLabel() + " provider"); if (configMode) { webAuthInfo.setUserCredentials(authAttrs); diff --git a/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java b/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java index a0e9a62b59..29aa81d210 100644 --- a/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java +++ b/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java @@ -1037,17 +1037,17 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen if (SMAuthProviderFederated.class.isAssignableFrom(authProviderInstance.getClass())) { //async auth var authProviderFederated = (SMAuthProviderFederated) authProviderInstance; - var redirectUrl = buildRedirectLink( - authProviderFederated.getSignInLink(authProviderConfigurationId, Map.of()), + var redirectUrl = buildRedirectLink(authProviderFederated.getSignInLink(authProviderConfigurationId, Map.of()), authAttemptId); - return SMAuthInfo.inProgress(authAttemptId, redirectUrl, filteredUserCreds); + Map authData = Map.of(new SMAuthConfigurationReference(authProviderId, + authProviderConfigurationId), filteredUserCreds); + return SMAuthInfo.inProgress(authAttemptId, redirectUrl, authData); } txn.commit(); return finishAuthentication( SMAuthInfo.inProgress( authAttemptId, - null, - Map.of(authProviderId, securedUserIdentifyingCredentials) + null, Map.of(new SMAuthConfigurationReference(authProviderId, null), securedUserIdentifyingCredentials) ), true, false @@ -1125,10 +1125,12 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen } @Override - public void updateAuthStatus(@NotNull String authId, - @NotNull SMAuthStatus authStatus, - @NotNull Map authInfo, - @Nullable String error) throws DBException { + public void updateAuthStatus( + @NotNull String authId, + @NotNull SMAuthStatus authStatus, + @NotNull Map authInfo, + @Nullable String error + ) throws DBException { var existAuthInfo = getAuthStatus(authId); if (existAuthInfo.getAuthStatus() != SMAuthStatus.IN_PROGRESS) { throw new SMException("Authorization already finished and cannot be updated"); @@ -1137,13 +1139,14 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen updateAuthStatus(authId, authStatus, authInfo, error, authSessionInfo.getSmSessionId()); } - private void updateAuthStatus(@NotNull String authId, - @NotNull SMAuthStatus authStatus, - @NotNull Map authInfo, - @Nullable String error, - @Nullable String smSessionId) throws DBException { - try (Connection dbCon = database.openConnection(); - JDBCTransaction txn = new JDBCTransaction(dbCon)) { + private void updateAuthStatus( + @NotNull String authId, + @NotNull SMAuthStatus authStatus, + @NotNull Map authInfo, + @Nullable String error, + @Nullable String smSessionId + ) throws DBException { + try (Connection dbCon = database.openConnection(); JDBCTransaction txn = new JDBCTransaction(dbCon)) { try (PreparedStatement dbStat = dbCon.prepareStatement( "UPDATE CB_AUTH_ATTEMPT SET AUTH_STATUS=?,AUTH_ERROR=?,SESSION_ID=? WHERE AUTH_ID=?")) { dbStat.setString(1, authStatus.toString()); @@ -1155,20 +1158,29 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen } } - for (Map.Entry entry : authInfo.entrySet()) { - String providerId = entry.getKey(); + for (Map.Entry entry : authInfo.entrySet()) { + SMAuthConfigurationReference providerId = entry.getKey(); String authJson = gson.toJson(entry.getValue()); - try (PreparedStatement dbStat = dbCon.prepareStatement( - "UPDATE CB_AUTH_ATTEMPT_INFO SET AUTH_STATE=? WHERE AUTH_ID=? AND AUTH_PROVIDER_ID=?")) { + boolean configIdExist = providerId.getAuthProviderConfigurationId() != null; + var sqlBuilder = new StringBuilder(); + sqlBuilder.append("UPDATE CB_AUTH_ATTEMPT_INFO SET AUTH_STATE=? ") + .append("WHERE AUTH_ID=? AND AUTH_PROVIDER_ID=? AND ") + .append(configIdExist ? "AUTH_PROVIDER_CONFIGURATION_ID=?" : "AUTH_PROVIDER_CONFIGURATION_ID IS NULL"); + try (PreparedStatement dbStat = dbCon.prepareStatement(sqlBuilder.toString())) { dbStat.setString(1, authJson); dbStat.setString(2, authId); - dbStat.setString(3, providerId); + dbStat.setString(3, providerId.getAuthProviderId()); + if (configIdExist) { + dbStat.setString(4, providerId.getAuthProviderConfigurationId()); + } if (dbStat.executeUpdate() <= 0) { try (PreparedStatement dbStatIns = dbCon.prepareStatement( - "INSERT INTO CB_AUTH_ATTEMPT_INFO (AUTH_ID,AUTH_PROVIDER_ID,AUTH_STATE) VALUES(?,?,?)")) { + "INSERT INTO CB_AUTH_ATTEMPT_INFO (AUTH_ID,AUTH_PROVIDER_ID,AUTH_PROVIDER_CONFIGURATION_ID,AUTH_STATE) " + + "VALUES(?,?,?,?)")) { dbStatIns.setString(1, authId); - dbStatIns.setString(2, providerId); - dbStatIns.setString(3, authJson); + dbStatIns.setString(2, providerId.getAuthProviderId()); + dbStatIns.setString(3, providerId.getAuthProviderConfigurationId()); + dbStatIns.setString(4, authJson); dbStatIns.execute(); } } @@ -1199,7 +1211,7 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen smSessionId = dbResult.getString(3); } } - Map authData = new LinkedHashMap<>(); + Map authData = new LinkedHashMap<>(); String redirectUrl = null; try (PreparedStatement dbStat = dbCon.prepareStatement( @@ -1217,14 +1229,13 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen WebAuthProviderDescriptor authProviderDescriptor = getAuthProvider(authProviderId); var authProviderInstance = authProviderDescriptor.getInstance(); if (SMAuthProviderFederated.class.isAssignableFrom(authProviderInstance.getClass())) { - redirectUrl = buildRedirectLink( - ((SMAuthProviderFederated) authProviderInstance).getRedirectLink(authProviderConfiguration, Map.of()), - authId - ); + redirectUrl = buildRedirectLink(((SMAuthProviderFederated) authProviderInstance).getRedirectLink( + authProviderConfiguration, + Map.of()), authId); } } - authData.put(authProviderId, authProviderData); + authData.put(new SMAuthConfigurationReference(authProviderId, authProviderConfiguration), authProviderData); } } } @@ -1368,7 +1379,7 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen if (authInfo.getAuthStatus() != SMAuthStatus.IN_PROGRESS) { throw new SMException("Authorization has already been completed with status: " + authInfo.getAuthStatus()); } - Set authProviderIds = authInfo.getAuthData().keySet(); + Set authProviderIds = authInfo.getAuthData().keySet(); if (authProviderIds.isEmpty()) { throw new SMException("Authorization providers are not defined"); } @@ -1386,20 +1397,19 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen } String activeUserId = permissions == null ? null : permissions.getUserId(); - Map storedUserData = new LinkedHashMap<>(); + Map storedUserData = new LinkedHashMap<>(); SMTeam[] allTeams = null; String detectedAuthRole = null; - for (String authProviderId : authProviderIds) { + for (SMAuthConfigurationReference authConfiguration : authProviderIds) { + String authProviderId = authConfiguration.getAuthProviderId(); WebAuthProviderDescriptor authProvider = getAuthProvider(authProviderId); - var userAuthData = (Map) authInfo.getAuthData().get(authProviderId); + var userAuthData = (Map) authInfo.getAuthData().get(authConfiguration); SMAutoAssign autoAssign = getAutoAssignUserData(authId, authProvider, userAuthData, finishAuthMonitor); if (autoAssign != null) { detectedAuthRole = autoAssign.getAuthRole(); } - var userIdFromCreds = findOrCreateExternalUserByCredentials( - authProvider, - authAttemptSessionInfo.getSessionParams(), + var userIdFromCreds = findOrCreateExternalUserByCredentials(authProvider, authAttemptSessionInfo.getSessionParams(), userAuthData, finishAuthMonitor, activeUserId, @@ -1423,10 +1433,8 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen if (activeUserId == null) { activeUserId = userIdFromCreds; } - storedUserData.put( - authProviderId, - saveSecuredCreds ? userAuthData : filterSecuredUserData(userAuthData, getAuthProvider(authProviderId)) - ); + storedUserData.put(authConfiguration, + saveSecuredCreds ? userAuthData : filterSecuredUserData(userAuthData, getAuthProvider(authProviderId))); } String tokenAuthRole = updateUserAuthRoleIfNeeded(activeUserId, detectedAuthRole); @@ -2156,4 +2164,8 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen return activeUserCredentials.getUserId(); } + private boolean isProviderEnabled(@NotNull String providerId) { + WebAuthConfiguration appConfiguration = application.getAuthConfiguration(); + return appConfiguration.isAuthProviderEnabled(providerId); + } } diff --git a/webapp/packages/core-authentication/src/AuthInfoService.ts b/webapp/packages/core-authentication/src/AuthInfoService.ts index fe38e6c7eb..6ad4f359bd 100644 --- a/webapp/packages/core-authentication/src/AuthInfoService.ts +++ b/webapp/packages/core-authentication/src/AuthInfoService.ts @@ -15,15 +15,20 @@ import { uuid } from '@cloudbeaver/core-utils'; import { AuthProvidersResource, AuthProviderConfiguration } from './AuthProvidersResource'; import { type ILoginOptions, UserInfoResource } from './UserInfoResource'; +export interface IUserAuthConfiguration { + providerId: string; + configuration: AuthProviderConfiguration; +} + @injectable() export class AuthInfoService { get userInfo(): UserInfo | null { return this.userInfoResource.data; } - get userAuthConfigurations(): AuthProviderConfiguration[] { + get userAuthConfigurations(): IUserAuthConfiguration[] { const tokens = this.userInfo?.authTokens; - const result: AuthProviderConfiguration[] = []; + const result: IUserAuthConfiguration[] = []; if (!tokens) { return result; @@ -41,7 +46,7 @@ export class AuthInfoService { ); if (configuration) { - result.push(configuration); + result.push({ providerId: provider.id, configuration }); } } } diff --git a/webapp/packages/core-authentication/src/UserInfoResource.ts b/webapp/packages/core-authentication/src/UserInfoResource.ts index 4ae186dbd1..979b45780a 100644 --- a/webapp/packages/core-authentication/src/UserInfoResource.ts +++ b/webapp/packages/core-authentication/src/UserInfoResource.ts @@ -158,9 +158,13 @@ UserInfoIncludes }); } - async logout(): Promise { - if (this.data) { - await this.graphQLService.sdk.authLogout(); + async logout(provider?: string, configuration?: string): Promise { + await this.graphQLService.sdk.authLogout({ + provider, + configuration, + }); + + if (!provider || (this.data?.authTokens.length || 0) <= 1) { this.setData(null); this.resetIncludes(); } diff --git a/webapp/packages/core-sdk/src/queries/authentication/authLogout.gql b/webapp/packages/core-sdk/src/queries/authentication/authLogout.gql index 842069abfa..86ec3b1489 100644 --- a/webapp/packages/core-sdk/src/queries/authentication/authLogout.gql +++ b/webapp/packages/core-sdk/src/queries/authentication/authLogout.gql @@ -1,3 +1,9 @@ -query authLogout { - authLogout +query authLogout( + $provider: ID + $configuration: ID +) { + authLogout( + provider: $provider + configuration: $configuration + ) } \ No newline at end of file diff --git a/webapp/packages/core-sdk/src/sdk.ts b/webapp/packages/core-sdk/src/sdk.ts index 1814514003..46fa5b8b2d 100644 --- a/webapp/packages/core-sdk/src/sdk.ts +++ b/webapp/packages/core-sdk/src/sdk.ts @@ -887,7 +887,6 @@ export interface ProjectInfo { export interface Query { activeUser?: Maybe; - allConnections: Array; authChangeLocalPassword: Scalars['Boolean']; authLogin: AuthInfo; authLogout?: Maybe; @@ -897,10 +896,6 @@ export interface Query { configureServer: Scalars['Boolean']; connectionFolders: Array; connectionInfo: ConnectionInfo; - /** @deprecated Field no longer supported */ - copyConnectionConfiguration: ConnectionInfo; - /** @deprecated Field no longer supported */ - createConnectionConfiguration: ConnectionInfo; createTeam: AdminTeamInfo; createUser: AdminUserInfo; dataTransferAvailableStreamProcessors: Array; @@ -909,8 +904,6 @@ export interface Query { dataTransferExportDataFromResults: AsyncTaskInfo; dataTransferRemoveDataFile?: Maybe; deleteAuthProviderConfiguration: Scalars['Boolean']; - /** @deprecated Field no longer supported */ - deleteConnectionConfiguration?: Maybe; deleteTeam?: Maybe; deleteUser?: Maybe; deleteUserMetaParameter: Scalars['Boolean']; @@ -969,19 +962,11 @@ export interface Query { sqlParseScript: SqlScriptInfo; sqlSupportedOperations: Array; templateConnections: Array; - /** @deprecated Field no longer supported */ - updateConnectionConfiguration: ConnectionInfo; updateTeam: AdminTeamInfo; userConnections: Array; } -export interface QueryAllConnectionsArgs { - id?: InputMaybe; - projectId: Scalars['ID']; -} - - export interface QueryAuthChangeLocalPasswordArgs { newPassword: Scalars['String']; oldPassword: Scalars['String']; @@ -1025,19 +1010,6 @@ export interface QueryConnectionInfoArgs { } -export interface QueryCopyConnectionConfigurationArgs { - config?: InputMaybe; - nodePath: Scalars['String']; - projectId: Scalars['ID']; -} - - -export interface QueryCreateConnectionConfigurationArgs { - config: ConnectionConfig; - projectId: Scalars['ID']; -} - - export interface QueryCreateTeamArgs { description?: InputMaybe; teamId: Scalars['ID']; @@ -1079,12 +1051,6 @@ export interface QueryDeleteAuthProviderConfigurationArgs { } -export interface QueryDeleteConnectionConfigurationArgs { - id: Scalars['ID']; - projectId: Scalars['ID']; -} - - export interface QueryDeleteTeamArgs { teamId: Scalars['ID']; } @@ -1372,13 +1338,6 @@ export interface QueryTemplateConnectionsArgs { } -export interface QueryUpdateConnectionConfigurationArgs { - config: ConnectionConfig; - id: Scalars['ID']; - projectId: Scalars['ID']; -} - - export interface QueryUpdateTeamArgs { description?: InputMaybe; teamId: Scalars['ID']; @@ -1711,7 +1670,10 @@ export type AuthLoginQueryVariables = Exact<{ export type AuthLoginQuery = { authInfo: { redirectLink?: string, authId?: string, authStatus: AuthStatus, userTokens?: Array<{ authProvider: string, authConfiguration?: string, loginTime: any, message?: string, origin: { type: string, subType?: string, displayName: string, icon?: string, details?: Array<{ id?: string, displayName?: string, description?: string, category?: string, dataType?: string, defaultValue?: any, validValues?: Array, value?: any, length: ObjectPropertyLength, features: Array, order: number }> } }> } }; -export type AuthLogoutQueryVariables = Exact<{ [key: string]: never; }>; +export type AuthLogoutQueryVariables = Exact<{ + provider?: InputMaybe; + configuration?: InputMaybe; +}>; export type AuthLogoutQuery = { authLogout?: boolean }; @@ -3178,8 +3140,8 @@ export const AuthLoginDocument = ` } ${AuthTokenFragmentDoc}`; export const AuthLogoutDocument = ` - query authLogout { - authLogout + query authLogout($provider: ID, $configuration: ID) { + authLogout(provider: $provider, configuration: $configuration) } `; export const DeleteAuthProviderConfigurationDocument = ` diff --git a/webapp/packages/plugin-authentication/src/AuthenticationService.ts b/webapp/packages/plugin-authentication/src/AuthenticationService.ts index bb5cff443f..c0a3edb2b2 100644 --- a/webapp/packages/plugin-authentication/src/AuthenticationService.ts +++ b/webapp/packages/plugin-authentication/src/AuthenticationService.ts @@ -9,7 +9,7 @@ import { observable } from 'mobx'; import { AdministrationScreenService } from '@cloudbeaver/core-administration'; -import { AppAuthService, AuthInfoService, AuthProviderContext, AuthProviderService, AuthProvidersResource, AUTH_PROVIDER_LOCAL_ID, RequestedProvider, UserInfoResource } from '@cloudbeaver/core-authentication'; +import { AppAuthService, AuthInfoService, AuthProviderContext, AuthProviderService, AuthProvidersResource, AUTH_PROVIDER_LOCAL_ID, IUserAuthConfiguration, RequestedProvider, UserInfoResource } from '@cloudbeaver/core-authentication'; import { injectable, Bootstrap } from '@cloudbeaver/core-di'; import type { DialogueStateResult } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; @@ -71,25 +71,30 @@ export class AuthenticationService extends Bootstrap { await this.auth(false, { providerId, linkUser }); } - async logout(): Promise { + async logout(providerId?: string, configurationId?: string): Promise { const contexts = await this.onLogout.execute('before'); if (ExecutorInterrupter.isInterrupted(contexts)) { return; } - if (this.authInfoService.userAuthConfigurations.length > 0) { - const userAuthConfiguration = this.authInfoService.userAuthConfigurations[0]; + let userAuthConfiguration: IUserAuthConfiguration | undefined = undefined; - if (userAuthConfiguration.signOutLink) { - this.logoutConfiguration(userAuthConfiguration.id, true); - } + if (providerId) { + userAuthConfiguration = this.authInfoService.userAuthConfigurations + .find(c => c.providerId === providerId && c.configuration.id === configurationId); + } else if (this.authInfoService.userAuthConfigurations.length > 0) { + userAuthConfiguration = this.authInfoService.userAuthConfigurations[0]; + } + + if (userAuthConfiguration?.configuration.signOutLink) { + this.logoutConfiguration(userAuthConfiguration); } try { - await this.userInfoResource.logout(); + await this.userInfoResource.logout(providerId, configurationId); - if (!this.administrationScreenService.isConfigurationMode) { + if (!this.administrationScreenService.isConfigurationMode && !providerId) { this.screenService.navigateToRoot(); } @@ -99,14 +104,11 @@ export class AuthenticationService extends Bootstrap { } } - logoutConfiguration(configurationId: string, full: boolean): void { - const userAuthConfiguration = this.authInfoService.userAuthConfigurations - .find(configuration => configuration.id === configurationId); - - if (userAuthConfiguration?.signOutLink) { - const id = `${userAuthConfiguration.id}-sign-out`; + private async logoutConfiguration(configuration: IUserAuthConfiguration): Promise { + if (configuration.configuration.signOutLink) { + const id = `${configuration.configuration.id}-sign-out`; const popup = this.windowsService.open(id, { - url: userAuthConfiguration.signOutLink, + url: configuration.configuration.signOutLink, target: id, width: 600, height: 700, @@ -116,18 +118,6 @@ export class AuthenticationService extends Bootstrap { popup.blur(); window.focus(); } - - if (!full) { - let maxTime = 1000 / 100 * 10; - - const interval = setInterval(() => { - if (popup?.location.href !== userAuthConfiguration.signOutLink || maxTime === 0) { - this.userInfoResource.markOutdated(); - clearInterval(interval); - } - maxTime--; - }, 100); - } } } diff --git a/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthTokens/AuthTokenList.tsx b/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthTokens/AuthTokenList.tsx index 82930b5373..96c186ec03 100644 --- a/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthTokens/AuthTokenList.tsx +++ b/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthTokens/AuthTokenList.tsx @@ -95,10 +95,10 @@ export const AuthTokenList = observer(function AuthTokenList({ user, clas > : undefined} - after={configuration && ( + after={(