mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#1978 SSO sign out (#2032)
This commit is contained in:
+11
-5
@@ -1323,17 +1323,19 @@ public class CBEmbeddedSecurityController<T extends WebAuthApplication>
|
||||
if (SMAuthProviderFederated.class.isAssignableFrom(authProviderInstance.getClass())) {
|
||||
//async auth
|
||||
var authProviderFederated = (SMAuthProviderFederated) authProviderInstance;
|
||||
var redirectUrl = buildRedirectLink(authProviderFederated.getSignInLink(authProviderConfigurationId, Map.of()),
|
||||
String signInLink = buildRedirectLink(authProviderFederated.getSignInLink(authProviderConfigurationId, Map.of()),
|
||||
authAttemptId);
|
||||
String signOutLink = authProviderFederated.getSignOutLink(authProviderConfigurationId, Map.of());
|
||||
Map<SMAuthConfigurationReference, Object> authData = Map.of(new SMAuthConfigurationReference(authProviderId,
|
||||
authProviderConfigurationId), filteredUserCreds);
|
||||
return SMAuthInfo.inProgress(authAttemptId, redirectUrl, authData);
|
||||
return SMAuthInfo.inProgress(authAttemptId, signInLink, signOutLink, authData);
|
||||
}
|
||||
txn.commit();
|
||||
return finishAuthentication(
|
||||
SMAuthInfo.inProgress(
|
||||
authAttemptId,
|
||||
null,
|
||||
null,
|
||||
Map.of(new SMAuthConfigurationReference(authProviderId, authProviderConfigurationId), securedUserIdentifyingCredentials)
|
||||
),
|
||||
true,
|
||||
@@ -1526,7 +1528,8 @@ public class CBEmbeddedSecurityController<T extends WebAuthApplication>
|
||||
}
|
||||
}
|
||||
Map<SMAuthConfigurationReference, Object> authData = new LinkedHashMap<>();
|
||||
String redirectUrl = null;
|
||||
String signInLink = null;
|
||||
String signOutLink = null;
|
||||
|
||||
try (PreparedStatement dbStat = dbCon.prepareStatement(
|
||||
database.normalizeTableNames(
|
||||
@@ -1545,7 +1548,10 @@ public class CBEmbeddedSecurityController<T extends WebAuthApplication>
|
||||
WebAuthProviderDescriptor authProviderDescriptor = getAuthProvider(authProviderId);
|
||||
var authProviderInstance = authProviderDescriptor.getInstance();
|
||||
if (SMAuthProviderFederated.class.isAssignableFrom(authProviderInstance.getClass())) {
|
||||
redirectUrl = buildRedirectLink(((SMAuthProviderFederated) authProviderInstance).getRedirectLink(
|
||||
signInLink = buildRedirectLink(((SMAuthProviderFederated) authProviderInstance).getRedirectLink(
|
||||
authProviderConfiguration,
|
||||
Map.of()), authId);
|
||||
signOutLink = buildRedirectLink(((SMAuthProviderFederated) authProviderInstance).getSignOutLink(
|
||||
authProviderConfiguration,
|
||||
Map.of()), authId);
|
||||
}
|
||||
@@ -1559,7 +1565,7 @@ public class CBEmbeddedSecurityController<T extends WebAuthApplication>
|
||||
if (smAuthStatus != SMAuthStatus.SUCCESS) {
|
||||
switch (smAuthStatus) {
|
||||
case IN_PROGRESS:
|
||||
return SMAuthInfo.inProgress(authId, redirectUrl, authData);
|
||||
return SMAuthInfo.inProgress(authId, signInLink, signOutLink, authData);
|
||||
case ERROR:
|
||||
return SMAuthInfo.error(authId, authError);
|
||||
case EXPIRED:
|
||||
|
||||
Reference in New Issue
Block a user