我正在将 KeyCloak v15 (WildFly v23) 密码从旧保险库迁移到 elytron 凭证存储。它适用于标准用例。在standalone.xml
中,我有
/server/extensions/extension
:
<extension module="org.wildfly.extension.elytron"/>
/server/profile/subsystem
:
<subsystem xmlns="urn:wildfly:elytron:13.0" final-providers="elytron" disallowed-providers="OracleUcrypto">
<providers>
<provider-loader name="elytron" module="org.wildfly.security.elytron"/>
</providers>
<audit-logging>
<file-audit-log name="local-audit" path="audit-log.log" relative-to="jboss.server.log.dir" format="JSON"/>
</audit-logging>
<credential-stores>
<credential-store name="credStore" location="/data/credStore.jceks">
<implementation-properties>
<property name="keyStoreType" value="JCEKS"/>
</implementation-properties>
<credential-reference clear-text="MASK-123456789;salt123;42"/>
</credential-store>
</credential-stores>
</subsystem>
我使用以下方式访问密码
/server/profile/subsystem[@xmlns="urn:jboss:domain:jgroups:8.0"]/stacks/stack[@name="tcp"]/auth-protocol/digest-token/shared-secret-reference
:
<shared-secret-reference store="credStore" alias="myBlock::mySecret"/>
但是,我需要将一个秘密传递给属性中的 SPI。知道怎么做吗?这是旧的保险库方式:
/server/system-properties/property
:
<property name="secret" value="${VAULT::myBlock::mySecret::1}"/>
/server/profile/subsystem[@xmlns="urn:jboss:domain:keycloak-server:1.1"]/spi
:
<spi name="mySpi">
<provider name="file" enabled="true">
<properties>
<property name="password" value="${secret}"/>
</properties>
</provider>
</spi>
我发现了两种可能性:
export SECRET="$(secret-getter-script)"
) 并使用变量 instandalone.xml
:我不得不重写我们的 SPI 来读取 Elytron 凭证存储内容: