It is working fine when the Proxy (that gets the details of a Refresh Token)is in the External Product until we moved the Proxy from External to Internal Product. Then we encountered the Error InvalidApiKey.
What do you mean by “moved the proxy” ? Are you saying that the Internal Product contains the proxy, and the External Product does not? The inquiry or validation of an oauth token will work only when executed within the scope of a proxy that is part of an API Product that the token is authorized for.
it seems to me that Apigee wants me to move the Proxy back as an External Product, all the while we need it to be accessible only to us (Internal Product).
Apigee doesn’t want you to do anything. But it is true that Apigee works according to some rules, and you need to set your expectations to align with those rules.
GetOAuthInfo on a token, will work only if the proxy in which GetOauthInfo executes, is part of an API Product, that is authorized for the given token.
AFAIK there is no way to generally interrogate the status of a token, outside of a proxy that is included in a Product, for which the token is authorized.
I hope this makes sense.
It’s possible that you need to get a different token.
In more detail:
Suppose 2 products: External and Internal
Internal includes proxy1 and proxy2
External includes proxy2 and proxy3
Suppose a single app, App1. App1 is authorized for API product: Internal.
client uses credentials for App1 to obtain a token. This token is good for use in any proxy that is included in the API Product: internal.
Client sends in a request to proxy1. Within that proxy, GetOAuthInfo is executed. Because the token is good for proxy1 (because proxy1 is configured under Internal, and because the token is authorized for Internal product) then GetOAuthInfo works.
Client sends in a request to proxy3. Within that proxy, GetOAuthInfo is executed. Because the token is not authorized for proxy3 (proxy3 is not configured under Internal), then GetOAuthInfo fails.
I don’t know what you mean by “moved the proxy”. If you delete proxyA from the list of proxies for ProductA, and the token is good only for ProductA, then a failure in GetOAuthInfo is expected behavior, if GetOauthInfo runs as part of proxyA.