{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
2
Question by zz_gshaw@us.westfield.com · May 26, 2016 at 05:51 PM · 1.3k Views errorserror handlingverify api key

Verify api key not reporting api key not approved

When I access our APIs with an api key that has an approval status of 'pending' in Edge, I'm seeing a InvalidApiKeyForGivenResource fault rather than a ApiKeyNotApproved fault, and have verified in trace that is the actual fault generated by the verify api key policy. Why, and how do I get the policy to respond with an accurate fault?

Comment
Add comment Show 2
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AMAR DEVEGOWDA ♦ · Jun 05, 2016 at 02:21 AM 0
Link

@George Shaw,

If you are on public cloud, could you please provide the API call (curl command) to reproduce the issue ?

If you are on private cloud, please do attach the screenshot showing the API key in pending state and trace file.

We will check and get back to you.

Regards,

Amar

avatar image Anil Sagar @ Google ♦♦ AMAR DEVEGOWDA ♦   · Jun 05, 2016 at 04:36 AM 0
Link

@AMAR DEVEGOWDA , It's a feature that has been missing from Apigee Edge. Verify API Key Policy should report "ApiKeyNotApproved" instead of "InvalidApiKeyForGivenResource" fault message (error code). Issue is reproducible across Apigee Edge. You can try to check same.

Close

2 Answers

  • Sort: 
avatar image
0

Answer by Anil Sagar @ Google   · Jun 05, 2016 at 06:00 PM

@George Shaw ,

Yes, you are right. We can able to reproduce this issue. Ideally, It has to give error code like "ApiKeyNotApproved".

There is a work around to solve this use case using "Access Entity Policy" & "Raise Fault Policy" for custom error response.

  • Use Access Entity Policy to retrieve APP information with Product Status
  • Use custom javascript to determine your APP Key status for particular product
  • Use Raise Fault Policy to set custom error message.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AccessEntity async="false" continueOnError="false" enabled="true" name="Access-Entity-1">
    <DisplayName>Access Entity-1</DisplayName>
    <Properties/>
    <EntityIdentifier ref="request.queryparam.apikey" type="consumerkey"/>
    <EntityType value="app"/>
</AccessEntity>
Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jws · Jun 20, 2017 at 07:40 PM

Was getting same InvalidApiKeyForGivenResource and found

link to update product

helpful

,

I noticed that I was getting an InvalidApiKeyForGivenResource error when trying to interact with a product that didnt have the environment enabled. The solution was to do a PUT as described here, with the environment specified in the post body. http://docs.apigee.com/management/apis/put/organizations/%7Borg_name%7D/apiproducts/%7Bapiproduct_name%7D

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to create test conditions for verify api key errors that are possible. 1 Answer

problem with the VerifyAPIKey policy: "Illegal repetition" error occurs 1 Answer

Known workaround for "Duplicate Header" issue 1 Answer

Handle Fault Rule for "messaging.adaptors.http.flow.ApplicationNotFound" 2 Answers

erro fetching virtual hosts; insufficient permissions 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges