到目前为止,我正在使用保险库通过 curl 登录以获取新令牌。这按预期工作:
curl -k --request POST --data '{"role_id":"myrole","secret_id":"mysecret"}' https://<host>:<port>/vault/v1/auth/approle/login
现在我想在 spring cloud 中使用以下 bootstrap.yml 做同样的事情:
spring.cloud.vault:
uri: https://<host>:<port>
authentication: APPROLE
app-role:
role-id: myrole
secret-id: mysecret
但这不起作用,应用程序在启动时抛出以下异常:
2018-09-06 07:28:57.054 INFO 8804 --- [ main] o.s.v.a.LifecycleAwareSessionManager : Scheduling Token renewal
2018-09-06 07:28:57.144 WARN 8804 --- [ main] LeaseEventPublisher$LoggingErrorListener : [RequestedSecret [path='secret/application', mode=ROTATE]] Lease [leaseId='null', leaseDuration=PT0S, renewable=false] Status 403 secret/application: permission denied
org.springframework.vault.VaultException: Status 403 secret/application: permission denied