Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbeaver/pro#1978 SSO sign out #2032

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1318,17 +1318,19 @@ public SMAuthInfo authenticate(
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,
Expand Down Expand Up @@ -1521,7 +1523,8 @@ private SMAuthInfo getAuthStatus(@NotNull String authId, boolean readExpiredData
}
}
Map<SMAuthConfigurationReference, Object> authData = new LinkedHashMap<>();
String redirectUrl = null;
String signInLink = null;
String signOutLink = null;

try (PreparedStatement dbStat = dbCon.prepareStatement(
database.normalizeTableNames(
Expand All @@ -1540,7 +1543,10 @@ private SMAuthInfo getAuthStatus(@NotNull String authId, boolean readExpiredData
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);
}
Expand All @@ -1554,7 +1560,7 @@ private SMAuthInfo getAuthStatus(@NotNull String authId, boolean readExpiredData
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:
Expand Down
Loading