BetterCloud / vault-java-driver

Zero-dependency Java client for HashiCorp's Vault
https://bettercloud.github.io/vault-java-driver/
334 stars 224 forks source link

Question: Need documentation : How to use loginByGCP(), How to generate JWT token? #243

Open vikasthange opened 3 years ago

vikasthange commented 3 years ago

Not an issue, just question. I apologies if this is not right forum for question.

I have been struggling to find out how to actually use GCP Auth with Vault as below script example. I am unable to find out how to get JWT token. Can someone please point to documentation or link?

AuthResponse response = vault.auth().loginByGCP("role goes here", "jwt token goes here");

In my case GCP Service account is assigned to my jenkins pod which has IAM role and vault name space has already configured to use GCP Auth login. However I am not able to find any documentation on how to generate JWT token from GCP service account assigned to my jenkins pod (vm). I would highly appreciate help.

darkedges commented 3 years ago

Take a look at https://www.vaultproject.io/docs/auth/gcp#generating-jwts it will help you out