Login unauthorized due to: lookup failed: invalid bearer token, square/go-jose: error in cryptographic primitive

I am using Inject Secrets into Kubernetes Pods via Vault Agent. I have 2 kubernetes clusters. I have configured the authentication for cluster 1 (kubernetes1). I successfully added the JWT token, ca certificate and hostname to the configuration and was able to successfully pull my secrets to the pod.

then I installed vault agent on my 2nd cluster(kubernetes2). I am sure I added the token and certificate correctly but I am getting the following error:

[ERROR] auth.kubernetes.auth_kubernetes_e0453d01: login unauthorized due to: lookup failed: [invalid bearer token, square/go-jose: error in cryptographic primitive]

What could be the reason for this? can you help?

I’m not an expert in k8s, but I think the problem is that you’re trying to use the same role. Setup a new role for the 2nd cluster.

I solved it thanks. The url information in my agent yaml deployment is /kubernetes by default. fixed it by changing it to my auth name