sensu-plugins / sensu-plugins-kubernetes

Sensu plugins for Kubernetes
http://sensu-plugins.io
MIT License
28 stars 36 forks source link

401 Unauthorised but able to hit with curl+token #111

Open mikeeaton83 opened 3 years ago

mikeeaton83 commented 3 years ago

Hi - I have the following issue:

When any of the checks run using token auth I get the following error:

Unable to authenticate the request due to an error: [invalid bearer token, square/go-jose: error in cryptographic primitive]\n

This is on a fresh kubernetes cluster - I've recreated the token / secret many times - I can use the token as a bearer with curl and this works absolutely fine. What can I do?

mikeeaton83 commented 3 years ago

So - although I've been completely ignored.. I've done some more testing after rebuilding my entire kubernetes cluster. If I use token substitution (labels) and pass in the bearer token and uri as labels I get an unauthorised error, if I pass in the actual token instead of using substitution it works fine.. can this please be looked at?

sensu-discourse commented 3 years ago

This issue has been mentioned on Sensu Community. There might be relevant details there:

https://discourse.sensu.io/t/kubernetes-plugin-unauthorised-when-using-labels-token-substitution-but-fine-when-not/2648/1