Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to get Product environment from request OauthV2 Credentails

Hello folks,

How to know the API product details(name and environment) when I receive a request to generate Access Token? We know below details when we receive request but I would like to know the product details associated with the credentials. Could you please someone help me?

  1. apigee.developer.app.name
  2. apigee.developer.email
  3. apigee.developer.id 

 

Solved Solved
1 3 227
1 ACCEPTED SOLUTION

You can gain access to such information within the API Proxy, using the AccessEntity policy. It will retrieve information based on the client_id. 

Example configuration

<AccessEntity name='AE-Developer-From-ClientID'>
  <EntityType value='developer' />
  <!-- 
    The thing referenced by the ref attribute must be the name of 
    a context variable containing a client ID (aka consumer key).
  -->
  <EntityIdentifier type='consumerkey' ref='client_id' />
</AccessEntity>

This documentation shows the data you get back from that policy.  It will get information about the developer, but not the app !

If you want information on the app, such as the app name, then you need a different AccessEntity policy. 

<AccessEntity name='AE-App-From-ClientID'>
  <EntityType value='app' />
  <EntityIdentifier type='consumerkey' ref='client_id' />
</AccessEntity>

This documentation shows what you get from that. It includes the app name. 

Why do you want this stuff?  Why is it important to know that stuff, before you issue the token? You get that information implicitly AFTER the token has been generated. So it seems ... unnecessary to explicitly query it, before you try to issue a token. 

View solution in original post

3 REPLIES 3
Top Solution Authors