I am trying to pull a database password from a Hashicorp vault using the vaultr package in R. I use this password in my R code to pull data from a SQL server.
The vault admin has provided a URL and token for me to use within my R script to pull my database password.
As per the vignette I have modified my project environment variables (usethis::edit_r_environ("project")) to include the vault address, the token and the auth method.
I then restart my R session and verify they are set as expected:
Sys.getenv(c("VAULT_ADDR", "VAULT_TOKEN", "VAULTR_AUTH_METHOD"))
VAULT_ADDR = https://mycompany.com/v1/Dept/APP/INFRASTRUCTURE/PROD/division/data/rx?version=1
VAULT_TOKEN = someRandomTokenHere
VAULTR_AUTH_METHOD = token
I have then tried to access the vault by creating a client:
vault <- vaultr::vault_client(login = TRUE, quiet = FALSE)
but when I run this step I get the following error:
Verifying token
Error: Token login failed with error: no data provided
I have tried searching for a solution to this but am finding nothing hence the S.O. question. If you have any pointers I would be grateful for advice.