mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-16 14:50:15 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20769431ba | ||
|
|
b7680d35cc |
@@ -529,7 +529,7 @@ public abstract class CBApplication<T extends CBServerConfig> extends
|
||||
}
|
||||
|
||||
if (isConfigurationMode()) {
|
||||
finishSecurityServiceConfiguration(adminName, adminPassword, authInfoList);
|
||||
finishSecurityServiceConfiguration(adminName.toLowerCase(), adminPassword, authInfoList);
|
||||
}
|
||||
|
||||
// Save runtime configuration
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import org.jkiss.dbeaver.model.websocket.event.WSEvent;
|
||||
|
||||
public class CBAbstractWebSocket extends Session.Listener.AbstractAutoDemanding {
|
||||
private static final Log log = Log.getLog(CBAbstractWebSocket.class);
|
||||
protected static final Gson gson = WSUtils.gson;
|
||||
protected static final Gson gson = WSUtils.clientGson;
|
||||
|
||||
public void handleEvent(WSEvent event) {
|
||||
if (!isOpen()) {
|
||||
|
||||
+6
-1
@@ -851,8 +851,13 @@ public class CBEmbeddedSecurityController<T extends WebAuthApplication>
|
||||
}
|
||||
List<String[]> transformedCredentials;
|
||||
WebAuthProviderDescriptor authProvider = getAuthProvider(authProviderId);
|
||||
if (authProvider.isCaseInsensitive() && !isSubjectExists(userId) && isSubjectExists(userId.toLowerCase())) {
|
||||
log.warn("User with id '" + userId + "' not found, credentials will be set for the user: " + userId.toLowerCase());
|
||||
userId = userId.toLowerCase();
|
||||
}
|
||||
try {
|
||||
SMAuthCredentialsProfile credProfile = getCredentialProfileByParameters(authProvider, credentials.keySet());
|
||||
String finalUserId = userId;
|
||||
transformedCredentials = credentials.entrySet().stream().map(cred -> {
|
||||
String propertyName = cred.getKey();
|
||||
AuthPropertyDescriptor property = credProfile.getCredentialParameter(propertyName);
|
||||
@@ -860,7 +865,7 @@ public class CBEmbeddedSecurityController<T extends WebAuthApplication>
|
||||
return null;
|
||||
}
|
||||
String encodedValue = CommonUtils.toString(cred.getValue());
|
||||
encodedValue = property.getEncryption().encrypt(userId, encodedValue);
|
||||
encodedValue = property.getEncryption().encrypt(finalUserId, encodedValue);
|
||||
return new String[]{propertyName, encodedValue};
|
||||
}).toList();
|
||||
} catch (Exception e) {
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
package io.cloudbeaver.service.security.db;
|
||||
|
||||
import org.jkiss.dbeaver.model.security.user.SMTeam;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,7 +27,7 @@ class CBDatabaseInitialData {
|
||||
private List<SMTeam> teams;
|
||||
|
||||
public String getAdminName() {
|
||||
return adminName;
|
||||
return CommonUtils.isEmpty(adminName) ? null : adminName.toLowerCase();
|
||||
}
|
||||
|
||||
public String getAdminPassword() {
|
||||
|
||||
Reference in New Issue
Block a user