Proxy with apikey is redirecting me instead of responding.

I am trying to create a proxy with apikey from tutorials (https://docs.apigee.com/tutorials/secure-calls-your-api-through-api-key-validation) I have followed all the steps but when I try the final API on postman or browser I don't get the expected output 'Hello, Guest'. I am getting HTML which is redirecting me on login page.

can anyone help me? I am new to APIGEE edge.

0 3 402
3 REPLIES 3

Hi @ravindrasingh, I have just gone through the tutorial was able to return the results correctly. I have done a few things trying to replicate your issue but without success. Can you give me more detail on your request by clicking on "code" link in your Postman UI

screen-shot-2018-02-19-at-102112-am.png

you will get something like:

curl -X GET \
  'http://xxxxx-eval-test.apigee.net/helloworld_apikey?apikey=9CrMS53vEvGyYSgRqA8VmfOZRDRNV3ixx' \
  -H 'cache-control: no-cache' \
  -H 'postman-token: 255281e9-007c-8d5d-ba00-1ce601276766'

THis is the error even redeployed the proxy.

<html> <header> <title>302</title> <meta http-equiv="refresh" content="0;url=https://mocktarget.login.apigee.com/oauth/authorize?client_id=unifiedui&response_type=code&redirect_uri=https%3A%2F%2Fmocktarget.apigee.com%2FoauthCallback&state=https%3A%2F%2Fmocktarget.apigee.com%2F"></meta> </header> <body> <a href="https://mocktarget.login.apigee.com/oauth/authorize?client_id=unifiedui&response_type=code&redirect_uri=https%3A%2F%2Fmocktarget.apigee.com%2FoauthCallback&state=https%3A%2F%2Fmocktarget.apigee.com%2F">https://mocktarget.login.apigee.com/oauth/authorize?client_id=unifiedui&response_type=code&redirect_uri=https%3A%2F%2Fmocktarget.apigee.com%2FoauthCallback&state=https%3A%2F%2Fmocktarget.apigee.com%2F</a> </body> </html>

I am getting this code on postman.

<!DOCTYPE html>
<html>
    <header>
        <title>302</title>
        <meta http-equiv="refresh" content="0;url=https://mocktarget.login.apigee.com/oauth/authorize?client_id=unifiedui&response_type=code&redirect_uri=https%3A%2F%2Fmocktarget.apigee.com%2FoauthCallback&state=https%3A%2F%2Fmocktarget.apigee.com%2F"></meta>
    </header>
    <body>
        <a href="https://mocktarget.login.apigee.com/oauth/authorize?client_id=unifiedui&response_type=code&redirect_uri=https%3A%2F%2Fmocktarget.apigee.com%2FoauthCallback&state=https%3A%2F%2Fmocktarget.apigee.com%2F">https://mocktarget.login.apigee.com/oauth/authorize?client_id=unifiedui&response_type=code&redirect_uri=https%3A%2F%2Fmocktarget.apigee.com%2FoauthCallback&state=https%3A%2F%2Fmocktarget.apigee.com%2F</a>
    </body>
</html>