Facing issue with generate JWT while generating JWT token

Please note: this is helpful, and works well, as long as you are not using Apigee X or hybrid. In Apigee X & hybrid, all the KVM are encrypted, so if you drop the private. prefix, you will get nothing loaded into your variables.

In those cases you can use an AssignMessage / AssignVariable for the same purpose. Just attach the policy immediately following the KVM policy. Something like this:

<AssignMessage name="AM-Diagnostics"> 
  <AssignVariable>
    <Name>observed1</Name>
    <Ref>private.variable-presumably-set-by-kvm-get</Ref>
  </AssignVariable>
  <AssignVariable>
    <Name>observed2</Name>
    <Ref>private.another-private-variable</Ref>
  </AssignVariable>
  
</AssignMessage>