I have a Hashicorp Vault server deployed with tls enabled to be able to login with a certificate. My certificate is stored in my browser certificate store. I want to request data from the vault in my frontend react app.
Now to be able to request data from the vault with the certificate, I have to call :
POST "https://{vault_domain}/v1/auth/cert/login"
The first time I call the endpoint I get prompted to select the certificate in my browser certificate personal store. And then I get the response with the client_token. Then I use the client_token in the header of all my vault calls to be authorized to call the vault endpoints. For example getting the public key key_name :
fetch("https://{vault_domain}/v1/transit/keys/key_name", {headers: { "X-Vault-Token": {client_token}}}
I find it very annoying to have to call the login endpoint to get the token and use token to make the other calls. Am I doing it right ? Is there an other way to do it ? To be automatically authorized if the certificate is in the store ?
And also is there a way to automatically check if a valid certificate is available and use it without prompting the user ?