Needed to travel for a workshop, so could not respond to you earlier.
The example token is the one coming from AZure AD and it looks like this :
I cannot give actual token as it is corporate one, it will be something similar with valid signature and other details. know this will indicate invalid signature. Token is validated in Java as well as on Jwt.io
I can best help you if you show me your VerifyJWT policy configuration. Are you able to do that?
Also, DESCRIBE the source of the RSA key. From where are you getting the public key? how are you specifying it to the VerifyJWT policy?
I also asked about the “error” context variable. And you wrote
I have not set any error variable right now.
You are misunderstanding. If the VerifyJWT policy fails, it will set the error variable. I want to know what the error is. You need to tell me that. Help me to help you.
Hi @raj, AFAIK the Source variable in policy is used to find the JWT. The Tenant_ID & App_ID shouldn’t go into the Source. You might get a FailedToDecode error.
If Tenant_ID & App_ID needs to be verified as part of claims, it can be done by using AdditionalClaims element in the policy.
You can also remove the Subject claim if you dont want to verify it.
The issuer in the JWT matches the string specified in the Issuer element in the policy.
I hope you are using an encrypted KVM or Assign Message policy before JWT policy to add the Secret Key Value.
As mentioned by @Dino-at-Google, when you invoke the proxy and if the JWT policy fails, it will give an error response. Please mention that to understand the issue,
In the future, It’s ok for you to cut/paste the XML for the VerifyJWT, rather than attaching a screenshot. It’s easier for everyone to see what you’re doing.
I can see that you have too many Source elements. And none of them are correct.
See Reiner’s answer for an good, working example to follow.
One clarification I have is why is service call out with Microsoft with tenant ID is returning null as a result token validation I’d failing. Actual error is “the service callout is returning 404 and it appears to be an error”.
What do you mean “it’s working fine” ? If you are getting a 404 from the ServiceCallout, then you have no keys, and surely the VerifyJWT policy will fail without keys. Right?
Which means it’s not working fine. Can you browse to the keys URL ? It should be public.
Hey @AdityaaSharma , thanks for engaging in the community!
Since this is an older, solved thread, your question may not get the right attention here. To ensure you get the best guidance, we recommend starting a new thread with details about your setup, the specific policy configuration you’re using, and the exact steps you’ve tried so far. Also feel free to take a look at this post with Tips to Ask Questions in the Apigee Forum.
That way, experts in the community can better assist you. Looking forward to your post!