how to get JWT token for kubernetes auth method? #211
-
how to get JWT token for kubernetes auth method in c#? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@vishalmehra2214 The Kubernetes Service Account JWT token (for your pod) is outside the purview of VaultSharp. Using CLI: Typically, you can get it as follows in 2 steps:
And if you want it via C#, assuming your code runs in the pod, use a Kubernetes C# client like https://github.com/kubernetes-client/csharp to load the config file and get hold of the JWT token for your service account. As I said, it is outside the purview of VaultSharp itself. |
Beta Was this translation helpful? Give feedback.
@vishalmehra2214 The Kubernetes Service Account JWT token (for your pod) is outside the purview of VaultSharp.
Still, here are a couple of pointers.
Using CLI: Typically, you can get it as follows in 2 steps:
Get the secret name for your service account
kubectl get serviceaccounts <account-name> -o yaml
For the secret name, get the actual JWT token
kubectl get secret <secret-name-from-above-output> -o yaml
And if you want it via C#, assuming your code runs in the pod, use a Kubernetes C# client like https://github.com/kubernetes-client/csharp to load the config file and get hold of the JWT token for your service account.
As I said, it is outside the purview of VaultSharp itself.