spring - 使用 APPROLE 拉取方法与 Spring Boot 进行 Vault 集成
问题描述
我是避难所的新手。我正在尝试使用 APPROLE 作为身份验证方法将 Vault 与 spring boot 集成。我对 bootstrap.yml 的配置如下:
spring:
application:
name: <application-name>
cloud:
vault:
host: <host-url>
scheme : https
port: <port>
kv-version: 2
namespace: <namespace-name>
authentication: APPROLE
app-role:
role-id: <role-id>
role: <role-name>
app-role-path: <path>
当我使用此配置运行时。我收到错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vaultTemplate' defined in class path resource [org/springframework/cloud/vault/config/VaultAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.vault.core.VaultTemplate]: Factory method 'vaultTemplate' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultSessionManager' defined in class path resource [org/springframework/cloud/vault/config/VaultAutoConfiguration.class]: Unsatisfied dependency expressed through method 'vaultSessionManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientAuthentication' defined in class path resource [org/springframework/cloud/vault/config/VaultAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.vault.authentication.ClientAuthentication]: Factory method 'clientAuthentication' threw exception; nested exception is java.lang.IllegalArgumentException: Token (spring.cloud.vault.token) must not be empty
我想知道如果我将身份验证方法用作 APPROLE,为什么它会要求令牌。
也可以使用全拉模式进行 APPROLE 身份验证,因为 secret-id 是动态的,不能存储在配置文件中。
解决方案
推荐阅读
- c# - 如何使用自定义图像和 onclick 功能在 C# Windows 应用程序中发出通知?
- c# - 如何映射 IEnumerable
到带有 IEnumerable 的 DTO 使用自动映射器的属性? - shell - Synology 用户定义脚本从远程 FTP 删除文件
- azure - 如何在 Cosmos 中使用存储过程来删除整个集合?
- javascript - Zendesk:将表单值放入主题时遇到问题
- python - 预测失败:sklearn 预测期间出现异常:“HistGradientBoostingClassifier”对象没有属性“n_features_”
- regex - 正则表达式过滤数字列表,如果它在某个位置包含 51
- amazon-dynamodb - 阶跃函数中的 dynamodb ConditionExpression
- reactjs - Emotion React 主题功能
- c# - 将 c++/cli dll 加载到 c# appdomains 的标准/正确方法是什么?