How to debug io.jwt.decode_verify when it failed to validate token #568
-
Hi, I am trying to use OPA to validate JWTs and the example on the official doc works fine. However, I can not get it work with my real tokens and there is no further information to debug. Here is the code and input data. https://play.openpolicyagent.org/p/U5GQV404tz Can anyone please advise what could be the issue? I did a bit of research and it seems Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi there! You should remove the wrapping Other than that it looks fine, but the token is AFAICS expired. But |
Beta Was this translation helpful? Give feedback.
Hi there!
You should remove the wrapping
"input"
attribute from theinput
object, as that's only part of the payload when calling the OPA serversv1/data
API.Other than that it looks fine, but the token is AFAICS expired.
But
io.jwt.decode_verify
is hard to debug. I normally opt to go with doing verification and decoding in two separate steps instead, then use normal Rego rules to verify the claims I want.