diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebSecretInfo.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebSecretInfo.java index ee412bde07a..bda9a0fd220 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebSecretInfo.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebSecretInfo.java @@ -16,6 +16,7 @@ */ package io.cloudbeaver.model; +import org.jkiss.code.NotNull; import org.jkiss.dbeaver.model.meta.Property; import org.jkiss.dbeaver.model.secret.DBSSecretValue; @@ -33,6 +34,10 @@ public String getDisplayName() { @Property public String getSecretId() { - return secretValue.getSubjectId(); + return buildComplexSecretId(secretValue); + } + + public static String buildComplexSecretId(@NotNull DBSSecretValue secretValue) { + return secretValue.getDisplayName() + "_" + secretValue.getSubjectId(); } } diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java index e814113d04d..f50368a1e8b 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java @@ -338,7 +338,7 @@ public WebConnectionInfo initConnection( } DBSSecretValue selectedSecret = allSecrets.stream() - .filter(secret -> selectedSecretId.equals(secret.getSubjectId())) + .filter(secret -> selectedSecretId.equals(WebSecretInfo.buildComplexSecretId(secret))) .findFirst().orElse(null); if (selectedSecret == null) { throw new DBWebException("Secret not found:" + selectedSecretId);