We also check the token along with the private key using this tool: Online JWT tool which worked and we got the decoded payload and we saw the actual json. So I’m not sure what is wrong on the vjwt policy.
If there’s something that I’m missing, please let me know. Thank you.
@dchiesa1 , thank you for responding. From what I understand, there is no support for external callouts when using the ECDH algorithm. Please correct me if I’m mistaken.
So you see, Apigee has built-in support for “encrypted JWT”, which is to say, for JWT that are encrypted according to the JWE spec. Another way to say it is, Apigee has support for JWE, only if the encrypted thing is a JSON object. But Apigee does not have built-in support for JWE in general. For that you need to use the external callout, which is limited in that it supports only RSA-based crypto algorithms.
To add to what I’ve tried using the token retrieved this is what I got from trying your tool
I see… so if I understand correctly, this is a JWE that uses ECDH-ES+A256KW, which encrypts a payload which itself is a serialized, signed JWT. That JWT is signed with ES256.
No problem on this one. Yea it would be best for us using a java or custom policy to decrypt this. Currently we are using a Cloud Function to do this necessary process.
I already tried it and during the testing on different proxies, I experienced both success and an error. Here’s a breakdown of how I’m using it (please let me know if I’m doing anything incorrectly. Your help is greatly appreciated!).
jwe_exception : java.lang.IllegalStateException: that key-encryption algorithm name is unsupported.
jwe_error : that key-encryption algorithm name is unsupported.
I also verified the tokens from both Proxy 1 and Proxy 2 using their respective private-key encryption with the Online JWT Tool to ensure that the key encryption used was correct, which it was. Therefore, I’m unsure why I encounter an error on Proxy1.
That’s interesting. I don’t have any good ideas why you would see a difference in behavior between one proxy and the next. It seems to me that you have exactly the same configuration as far as key encryption.
The I can suggest is to undeploy, and possibly delete, proxy 1. Then re-import that proxy and redeploy it.