{ 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
3

Oauth2.0 Access Token Verification throws “Invalid API call as no apiproduct match found” error  

  • Export to PDF
AMAR DEVEGOWDA created · Jul 09, 2015 at 09:00 AM · 7.2k Views

When using Oauth2.0, one of the errors observed is:

{"fault":{"faultstring":"Invalid API call as no apiproduct match found","detail":{"errorcode":"keymanagement.service.InvalidAPICallAsNoApiProductMatchFound"}}}

I would like to explain here a few possible causes for this error with the help of an example.

Example

Let's say we have the Environment, API Proxies, Products, Developer Apps and Developer setup in an org “sample” as shown below:

Environments

test

prod

API Proxies

API_One deployed in prod and test environments

API_Two deployed in prod and test environments

Products

Product_One associated with API_One. Product_One is enabled for test environment only.

Product_Two associated with API_Two. Product_Two is enabled for prod environment only.

DeveloperApps

App_One associated with Product_One

App_Two associated with Product_Two

Developers

Dev_One associated with App_One

Dev_Two associated with App_Two

With this setup, we can get the "Invalid API call as no apiproduct match found" error with the following scenarios listed below:

Scenario 1

  • Generate the access token by using the Client_ID/Client_Secret from “App_Two”
  • Run the API call for “API_One” with the above generated access token

In this scenario, we are using the access token generated for App_Two that is linked with Product_Two /API_Two to run the API call for API_One. This is a clear mismatch.

Scenario 2

  • Generate the access token by using the Client_ID/Client_Secret from “App_One”
  • Run the API call for “API_One” with the above generated access token for prod environment

In this scenario, we are using the access token generated for App_One in prod environment. However, the App_One is associated with Product_One, which is enabled only for test environment for the APIProxy “API_One”. This is a clear mismatch.

In summary, here are a few possible causes for the error “Invalid API call as no apiproduct match found" when using OAuth2.0

  1. Access token generated with Client_ID/Client_Secret from a DeveloperApp-Product unrelated to an API Proxy
  2. Access token generated with Client_ID/Client_Secret from a Product-DeveloperApp unrelated to environment in which the API call is tested

Solution

To avoid the error“Invalid API call as no apiproduct match found", we need to

  • Generate the access token using the Client_ID/Client_Secret from the DeveloperApp-Product associated with a specific API Proxy
  • Use the generated access token to run the API call for the specific API Proxy in the specific environment (s) in which the Product is enabled.

In the example quoted above, we should do the following to avoid the error“Invalid API call as no apiproduct match found"

  • Generate the access token using the Client_ID/Client_Secret from the DeveloperApp “App_One”.
  • App_One is associated with Product_One (enabled in test environment), which is further associated with API_One proxy.
  • Run the API call with the generated access for API_One proxy only in test environment.
thub.nodes.view.add-new-comment
oauth 2.0
Add comment Show 1
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 Hari · Apr 10, 2018 at 11:48 AM 1
Link

This same error will also be seen in cases where the API Product approval type is set to 'Manual' and the Product has not been approved in the App yet.

So Basically :

1. Create Proxy, secure it with OAuth2.0 VerifyAccessToken

2. Create Product, add the proxy to generate token and the api proxy to be secured (created in 1). Set the approval as 'Manual'

3. Create App, add above product to app.

4. Generate Token.

5. Send request to protected API Proxy with token genrated in (4).

6. Get 'InvalidAPICallAsNoApiProductMatchFound'

7. Go to App->Edit->Approve the product->Save

8. Send request to protected API Proxy with token genrated in (4)

9. Watch in satisfaction/frustration/relief as OAuth token verification is successful

Article

Contributors

avatar image

Follow this article

19 People are following this .

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

Navigation

Oauth2.0 Access Token Verification throws “Invalid API call as no apiproduct match found” error

Related Articles

Apigee as OAuth Resource Server - PingFederate as OAuth Authorization Server with synchronized client IDs.

Oauth2.0: Validity of access tokens across environments

How to enable client_credentials and password grant flows for SmartDocs

Apigee as OAuth Resource Server - PingFederate as OAuth Authorization Server with dynamic client id mapping.

Apigee as OAuth Provider - PingFederate as IdentityProvider : using OpenID Connect Flow

Auth0 with Apigee

Dispensing tokens via OAuthV2 with PKCE (RFC 7636)

  • 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