Apigee proxy test returns google login screen as response.

As a part of "API Development on Apigee platform" course, I am trying to test proxy which I just created. The creation was successful but when I run "GET https://XXXXX-test.apigee.net/v1/products/18841" from POSTMAN (or Chrome's RESTClient), I get the Google's login screen as response (I could see in preview mode). If I copy the same url in the browser, it shows correct page in the firebase/database/product section with product details. Which implies that the proxy URL conversion to actual target endpoint is proper. To me it looks like some configuration settings are not right in my environment.

Any help or pointers would be greatly appreciated. Because of this, I am not able to progress to subsequent labs.

0 6 293
6 REPLIES 6

Another thing I noticed, my apigee-edge account email address is different than the GCP firebase account. Does this make any difference? So when the apigee proxy transforms request to target endpoint it cannot reach the endpoint without GCP login credentials?

sidd-harth
Participant V

This is a Firebase issue. I guess you have authentication enabled to read data from Firebase.

Modify the rules in your Firebase,

{
  "rules": {
    ".read": "true",
    ".write": "auth != null"
  }
}

This means that anyone with the Firebase Url can read the data but for writing, you need to provide proper credentials.

You might have already logged into your Firebase account in Browser, so it might be a reason it is working in your browser. In Postman since there is no session, it will ask credentials through login page.

The different email address is not an issue.

Thanks for the response Siddharth ! I already had the rules set as follows and the firebase simulator was allowing the access:

{

"rules":{

".read":"auth == null",

".write":"auth == null"

}

}

Now I modified the rules as you suggested and I still see the same result. Also, as you mentioned, from browser it is using the credentials in the session (when I logout from session and try the url, it throws login screen).

Any other suggestions?

Can you provide URL of your collection?

Are you ending the URL with collection-name.json?

I was about to update you, if I try with ".json" at the end of URL, it works as expected. i.e if I try " https://XXXXX-test.apigee.net/v1/products/18841.json" it works ok. Not sure why?

That is the expected behaviour of Firebase Collections.

You need to append the collection-name.json at the end of the URL to access the records.