Unable to access JWT flow variables afte VerifyJWT policy execution

When trying to access flow variables generated by the VerifyJWT policy they are null.jwtverifytrace.jpg is a screen shot, I see the values I want in the trace but when I try to access them in a subsequent js policy they are null. Sample JS:

var body = context.getVariable("jwt.VerifyJWT.payload-json");

the body var is null. But I can see it in the trace during the verify step.

I

Solved Solved
1 5 352
1 ACCEPTED SOLUTION

It was a variable problem. we used a reserved name for our variable and it collided with apigee.

View solution in original post

5 REPLIES 5

Hi @Mark Ruscitto, from the image, I see that the flow variable have not equals sign, it means that the value was not set, the variable may be read-only or an error may have prevented the value from being set.

More info here,

https://docs.apigee.com/api-platform/debug/using-trace-tool-0#understandingthephasedetails

Thanks Siddharth, my teammate determined that It appeared to be related to having the generate policy and Verify or Decode policy together in the same flow resulted in this situation. I was using a single flow to test development. Once we removed the generate policy the verify/decode policy functioned as expected. Thanks for youe response.

It was a variable problem. we used a reserved name for our variable and it collided with apigee.

What variable?

It's frustrating that Apigee Edge allows you to overwrite so-called "reserved" variables.

In the prior step we used a reserved word (jwt) for the variable assignment. This was the cause of the problem.