Disable API discovery for API Explorer - google-app-engine

I'm new to App Engine and am trying to figure out how to disable the API Explorer from showing all my APIs, which are currently public and available to anyone visiting [MYPROJECT].appspot.com/_ah/api/explorer
Supposedly Snapchat uses AppEngine, however visiting https://apis-explorer.appspot.com/apis-explorer/?base=https://feelinsonice.appspot.com/_ah/api#p/ does not reveal their APIs.
Viewing network activity for that page you'll see that requests are being made to https://feelinsonice.appspot.com/_ah/api/discovery/v1/apis but returning a 404.
How do I do the same?
When visiting the API Explorer using my project ID I see this:
Is this the culprit?

Endpoints is the 'culprit'. I'm assuming you are using endpoints since you've included that tag, and I guess snapchat doesn't use endpoints.
There is nothing you can do to change this other then stop using endpoints.

Related

Google cloud endpoints service is not listed in api library

I'm trying to share my API (with a custom domain) with the customer( service consumer role), but this API is not listed in the API library. When he tries to open API using the link to generate API key he gots errors. The same problem I have when I try to generate API key for customers. I'm using endpoints frameworks for the GAE standard environment. Image
This one looks more like a problem with the Cloud console or the Cloud APIs, I'd better address the issue at a Public Issue Tracker (PIT), you can open one in here, and preferably add a relevant HAR file that should contain some additional information of the response message.
This will help to correctly address any ongoing service issue.

How to access the Google Maps Directions API client-side from a library

I'd like to send requests against the Google Directions API. Google provides a Node.JS client library for the API. However, this AP is server-side only. Attempting to use it from a browser script results in a CORS failure. Multiple past answers (such as this one) indicate that this library simply can't be used in this way.
The alternative is to use the client-side JavaScript API. However, this requires adding a <script> tag to the document root. That's the wrong level of abstraction for my needs. I'd like to use a method from a library or dot-js file instead.
Following the advice given here, I'd like to ask: is there a module available through npm I can use to query the Google Directions API client-side?
It's not naively possible to access the Google Maps Directions API from the client side. Web browsers implement the Single-Origin Policy, which requires that any requests to a domain come from the same domain. Requires between domains are disallowed by default. Cross-domain requests can be enabled at the server lever by setting the right CORS headers on the endpoint, but the Google Maps servers choose not to do this.
There are two ways of working around this. One is to wrap the request using the Google API Auth library. However, I could not get this to work.
What did work was using a reverse proxy. This workaround is actually mentioned in the Google Directions API intro page (albeit obliquely). You will need to set up a server which forwards any requests to an API request, then returns that API request to the original requester. Since this is now a server-side request, SOP will not apply, and you will be good to go.
For an example implementation check out this repository on GitHub.
https://developers.google.com/maps/documentation/directions
This is the Directions API web service. It does not require adding a <script> tag.
You can make direct requests to the service as per the example:
https://maps.googleapis.com/maps/api/directions/json?origin=75+9th+Ave+New+York,+NY&destination=MetLife+Stadium+1+MetLife+Stadium+Dr+East+Rutherford,+NJ+07073&key=YOUR_API_KEY
once you have generated an API key and replaced YOUR_API_KEY in the request with your own key.

Google App Engine Python Authenticated Endpoints and Android

I'm not able to find a small example (or tutorial) of Android App (possibly with Android Studio) that use Authenticated Endpoints realized with GAE (possibly Python).
Google examples (Greetings and Tic Tac Toe) seems have some problem in my environment (token error, 404 not found, .....).
Can anyone help me? I'm going crazy...
Thank you in advance.
Are you able to access your Endpoint from api Explorer on localhost(http://localhost:8080/_ah/api/explorer ) you can even simulate authentication there.
if API explorer is working then you need to check how you define SCOPE when getting credentials.
In my experience I had problems in following areas:
1. Generating Client IDs
2. define scoping in Endpoint API
3. Specifying correct scope in android App (server:client_id:123456789-abcdefghsadffwe.apps.googleusercontent.com";
I'm finally able to do it.
I used this 2 google examples:
On the server side:
https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-python
On the client side:
https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-android
The instructions inside this pages are, in my opinion, better than the official google documentation.

Access not configured error message

I've set up oauth and am properly retrieving an access token.
Here is the response I get from hitting
https://www.google.com/accounts/AuthSubTokenInfo?access_token=<token>
parsed_response="Target=645428735890.apps.googleusercontent.com\nSecure=false\nScope=https://www.googleapis.com/auth/userinfo.profile\nScope2=https://www.googleapis.com/auth/userinfo.email\nScope3=https://www.googleapis.com/auth/glass.timeline\nScope4=https://www.googleapis.com/auth/glass.location\n"
which I believe properly shows that I have requested the correct permissions.
A call to
https://www.googleapis.com/mirror/v1/timeline?access_token=<token>
yields:
"errors"=>[{"domain"=>"usageLimits", "reason"=>"accessNotConfigured", "message"=>"Access Not Configured"}]
Having trouble figuring out what this means. I don't have an actual piece of glass hardware. The docs make it seem like this access token would allow me to make any requests to the mirror api.
Is there an additional setup or permission I need to ask for that I missed? On the application side? Is this related to my google account and having not set up glass?
EDIT:
Okay, from the authorization docs:
Select the Services tab in your API project, and enable the Google Mirror API.
However, I'm not seeing Google Mirror API listed on the services tab?
The Mirror API is currently in developer preview and access is limited to I/O Explorers who have received their Glass device. You can subscribed to this issue on our issue tracker to get updates on when the Mirror API will be public.

GAE Java Facebook server authentication double call

I am having a weird issue. I created an application on Google App Engine and have a Login with Facebook button on it, for which I am doing server side authentication.
I give the redirect_url, and facebook was calling the URL correctly with no issues. The session parameters that I set were being retrieved on the redirect call and everything was working fine.
Yesterday, I got a domain on godaddy and mapped it to my appspot account using google apps. Now when I click on Facebook login, I am getting two calls on the redirect uri, the first one carries the session varaibles and the session one doesn't. I am not very familiar with domain mapping and followed the steps on Google Apps.
Can anyone help me in the right direction on this.
it's a little out of date, but i documented some GAE to Facebook gotchas here:
http://javagwt.blogspot.com/2010/08/facebook-apps-on-app-engine-without-any.html
It may also help to read about naked domain mapping with godaddy, to make sure you're not getting bounced around. Even though you are mapped to your domain through google apps, you can try to put the redirect URL for facebook as yourappid.appspot.com - the redirect URL you provide, and the one in your facebook app settings must match.
My app, nimbits.com writes to facebook from GAE all of the time - the code is on github under server/facebook
https://github.com/bsautner/com.nimbits/tree/master/nimbits-tds/src/com/nimbits/server
Thanks for the answers bsautner and Michele. I finally figured out the issue. I have google ads on my website. The google ads was trying to parse the URL content and creating a second request for every request that I create. After removing the google ads, I get a single callback with session values retained. It all works now. The final output is this website - www.imagecrashers.com. I will be glad for any suggestions from the gurus here, regarding layout or api calls simplification. Thanks again to all.

Resources