I have configured multiple apps and I want to know that which app is sending me request. Is there a way to do that ?
Assuming you are using a Verify Api Key policy. You can use “apigee.developer.app.name” or “verifyapikey.{verify-api-key-policy}.developer.app.name” to get the app name. You can see the list of variables in your trace session under this policy
You can use context.getVariable(name) within your Javascript appropriately.
More info here
Please click “accept” if you accept the answer.
You can take a look at Access Entity policy too
Following are the list of flow variables that get populated when the verifyapikey policy gets executed successfully:
verifyapikey.VerifyAPIKey.apiproduct.name
verifyapikey.VerifyAPIKey.client_id
verifyapikey.VerifyAPIKey.client_secret
verifyapikey.VerifyAPIKey.developer.app.id
verifyapikey.VerifyAPIKey.developer.app.name
verifyapikey.VerifyAPIKey.developer.email
verifyapikey.VerifyAPIKey.developer.id
verifyapikey.VerifyAPIKey.DisplayName
verifyapikey.VerifyAPIKey.expires_in
verifyapikey.VerifyAPIKey.failed
verifyapikey.VerifyAPIKey.issued_at
verifyapikey.VerifyAPIKey.Notes
verifyapikey.VerifyAPIKey.redirection_uris
verifyapikey.VerifyAPIKey.status
I hope this list helps you.
well, thanks for your answer. I am using OAuth V2.0 policy not Verify Api Key policy. So This variables will not be useful for me.
well, thanks for your answer. I am using OAuth V2.0 policy not Verify Api Key policy. So This variables will not be useful for me.
I wrote a sample policy that uses OAuth policy - VerifyAccessToken operation. After the execution, I have a simple Javascript policy that prints “developer.app.name”. App name printed as expected. Isn’t this working for you ?
Please refer to the doc link here for the flow variables in case you are using OAuth v2.0 policies. Refer to the section called “Flow Variables”
@arghya das Thanks a lot !!! That will help me.
Hi @arghya das Does this list above work with OAuth Access Token validation policy instead of verifying api key? Do you know an easy way to retrieve developer custom attribute using a flow variable?
Thanks,
Krish
Yes @Krish - Please refer to this link
You can access the custom attributes as flow variables by using
accesstoken.{custom_attribute}
It didn’t work.
Here is my Javascript added after the Validation access token policy in proxy preflow.
print(“name==>”+context.getVariable(“accesstoken.spikeLimit”)); print(“Limit==>”+context.getVariable(“APICommon_oAuthV2_ValidateAccessToken.spikeLimit”));
Both printed as null.
Here is my Validate access token policy.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> APICommon_oAuthV2_ValidateAccessToken VerifyAccessTokenThanks,
Krish
Try this - The above is true if you are setting the attributes using the tag in the GenerateAccessToken policy in your OAuth proxy. If you are trying to get the custom attributes from your Product or Developer App configurations, then the flow variables are
apiproduct.{custom_attribute}
app.{custom_attributes}
On the trace tool, click the APICommon_oAuthV2_ValidateAccessToken to get the variables and you can use that

You are amazing. Thank you @Sai Saran Vaidyanathan !
Happy to help !!! ![]()
Hi @utsav kansara - Is this resolved ?
Hi is there way to get App name when no verify API key policy is used. Instead verifyJWT policy is used. I believe variable listed allow will work only when verify API policy is in use.
I believe variable listed allow will work only when verify API policy is in use.
correct.
No. If you use VerifyJWT, then, to get the registered Apigee App, you must follow it by calling VerifyAPIKey. Usually you would specify as the APIKey, a claim (like clientid) that is present in the JWT.
FYI: you are replying to a thread which is 6 years old. Sometimes new questions posted in comments to old threads are completely missed, ignored! I suggest that next time, you post your own question in a new thread.