I am running a trace in apigee and making requests through PostMan. Some requests are successful (200 OK Response) passing verification, and some requests fail api key verification with this message:
{ "fault": { "faultstring": "Invalid ApiKey for given resource", "detail": { "errorcode": "oauth.v2.InvalidApiKeyForGivenResource" } } }
Successful requests will log in trace but failed requests do not.
Hi @Sean Free, are you using the same API Key for all the calls?
InvalidApiKeyForGivenResource means the API Key is valid but is not approved in Developer Apps.
One example is,
So please check the environment on which calls are made.
Yes all of the calls are using the same API key, and the calls are all going to my dev environment, I've only deployed the proxy to dev.
Can you please check the API Product, did you add all the resources(conditional flows) in the API Product?
If a resource is not added to API Product then I think we will get InvalidApiKeyForGivenResource error while accessing it.
For more clarity please check point 13 in below link,
https://docs.apigee.com/api-platform/publish/create-api-products#createproduct
Yes it's been added to the api product. Some requests go through without any problems and I can see them in trace, about 25% of requests fail with the InvalidApiKeyForGivenResource error and don't appear in trace.
Hi @Sean Free, may we know which Apigee account you are using Cloud(Free/Paid), On-Premise?
++ @Anil Sagar @ Google @Dino-at-Google @AMAR DEVEGOWDA for more info.
Thanks for letting us know about this. I have added some info to investigate this issue further.
If you have one or more API Proxies with a part of the basepath being same, then there's a possibility that some calls may get routed to different API Proxy depending on the path suffix and conditions used in the API Proxies and the path used in your actual API request. You may not see the trace for such calls. So I would suggest you to do the following:
If you need any further help, please contact Apigee Support.
@Siddharth Barahalikar, @AMAR DEVEGOWDA
I'm using an on-premise apigee. Currently working with an internal team to troubleshoot and hopefully fix the issue, I'll post the results once it's resolved.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |