How to add a custom attribute to API products at runtime

Currently I am adding a custom attribute oidc-login-optional = true to an API product via Edge manually. I need to find a way to do this via Proxy.xml. It would be great if I can add the oidc-login-optional attribute to a given list of ApiProducts

0 3 111
3 REPLIES 3

What do you mean "via Proxy.xml"? Is that a maven plugin thing?

Elaborate on what you are trying to do.

That's not a plugin but what I meant was like we have policies in place which we include part of a proxy, Can I add custom headers to the API product using any of the policies? My requirement is that not all but most of the API products need to have the above mentioned attribute.

No, you cannot modify API Products from Policies in the proxy.

That's not how it's designed to work.

An API Product is an entity that gets created and modified administratively. In Apigee Edge, modifying an API Product from within an API Proxy.... is not a supported use case.

If you're thinking you need or want to modify the API Product from within a request flow in an API Proxy.... you're probably thinking about the problem in an unnatural way. Reconsider your use case, and see if you can address things differently.