apigee-127 / a127-documentation

Documentation for Apigee-127
113 stars 24 forks source link

question: Having trouble getting my app to use the customerKey for the product rather than the remote proxy when deployed to Apigee .... #10

Closed emcpadden closed 9 years ago

emcpadden commented 9 years ago

I am having trouble getting apikey security to work when deployed to Apigee.

I have it working using a remote proxy on my machine using the customerKey in APigee for my remote proxy.

When I deploy to Apigee, the apikey security still works if I use the customerKey for my remote proxy. I am confused as how to configure things so that it will use the customerKey for a product that contains my API (instead of the remote proxy customerKey).

Here is what is in my swagger file for x-a127-config and x-a127-service:

x-a127-config: 
  remote.key: &apigeeProxyKey CONFIGURED
  remote.uri: &apigeeProxyUri CONFIGURED
  oauthProvider: &oauthProvider CONFIGURED
  synergyUri: &synergyUri CONFIGURED
  synergyApiKey: &synergyApiKey CONFIGURED
x-a127-services: 
  apiKeyHeaderSecurity:
    provider: *oauthProvider
    options:
      uri: *apigeeProxyUri
      key: *apigeeProxyKey 
  apiKeyQuerySecurity:
    provider: *oauthProvider
    options:
      uri: *apigeeProxyUri
      key: *apigeeProxyKey 

Please let me know if there is anything else I should be telling you about my code.

Is there some other configuration that I need to do to get my app to use the customerKey defined for the app when it is deployed to Apigee?

Thanks for your help, ...Ed

WWitman commented 9 years ago

Hi Ed, I'm going to run through the steps to see if I have the same problem (or not). Will

emcpadden commented 9 years ago

Thanks Will ... I'm wondering if I'm doing something wrong. I know that when I'm working remotely I need to use the remote proxy so I guess it makes sense that I would use that CustomerKey but I just can't see how to tell it to use the product customerKey that the API belongs to when I am running it from Apigee.

If you could show me what I need to do to run both remotely and on Apigee and how to configure so it works for both using the right CustomerKey.

I really appreciate your help with this. THANKS!

WWitman commented 9 years ago

Hi Ed,

I spent some time trying different scenarios with ApiKey. I think this might be related to a problem, not something you're doing wrong.

Q: In your product (the one you created, not the one associated with the RemoteProxy service) -- is there a Resource Path set? Is it set to something other than "/" or "/**" ?

If the answer is yes, try this: In that product, set the Resource Path to : "/". Remove any other paths. Then, save and hit the proxy again.

emcpadden commented 9 years ago

Hi Will,

I just went to the product and made the resource path just "/" and that did the trick!

Thanks so much for your help with this.

...Ed