I was using vault to login via curl to get a new token so far. This works as expected:
curl -k --request POST --data '{"role_id":"myrole","secret_id":"mysecret"}' https://<host>:<port>/vault/v1/auth/approle/login
Now I'd like to do the same in spring cloud with the following bootstrap.yml:
spring.cloud.vault:
uri: https://<host>:<port>
authentication: APPROLE
app-role:
role-id: myrole
secret-id: mysecret
But this isn't working and the application throws the following exception on startup:
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