0

I am trying to learn to use Google App Engine and not having much luck.

Has anyone gotten the Tic Tac Toe example for Google App Engine(Java version) to work? I have been trying to get this example to work - developers.google.com/appengine/docs/java/endpoints/

This is the code for it -

`github.com/GoogleCloudPlatform/appengine-endpoints-tictactoe-java`

While I can get the app up and running , I can't get the OAUTH part it to work/authenticate .

The second ,lesser, problem is I am trying to use the web client part of it but it doesn't find the app from a browser unless run it via the api explorer. If I wrap it in - ../_ah/api/explorer , I can get it to make make an unauthorized call (getmove()) but any of the other methods do not work.

The functions that require oauth fail miserably.

I even have my google plus email listed in the permissions of the app . I'll even be logged in to Google Plus and the OAUTH fails.

I changed the client id where the readme file directed.

I get the following response.

401 Unauthorized

  • Show headers -

    { "error": { "message": "com.google.appengine.api.oauth.OAuthRequestException: Invalid user.", "code": 401, "errors": [ { "domain": "global", "reason": "required", "message": "com.google.appengine.api.oauth.OAuthRequestException: Invalid user." } ] } }

This has taken way too long . Any help would be useful.

Thanks.

  • I'm on the same boat. I've been studying this google app engine three days a week for about 3 months and I'm shocked at the poor examples. I expected better from Google. I used parse.com for notifications in my two iOS apps and their example are very clear. Sadly parse.com can't hold a candle to Google app engine (and endpoints). I'm making headway on this now. I'm able to deploy the tic tac toe app to the app engine using eclipse plug in, but when I run the webapp it states "You must sign in to play" – ConfusedDeer Dec 30 '13 at 04:35
  • What are you using? I found that eclipse appengine plugin works well and is easier than trying to use the google app engine command line tool. Like I said in my previous post, I'm currently having a small issue with the "You must sign in to play", but I've overcame all the other numerous issues I've had with their examples. There were quite a few. – ConfusedDeer Dec 30 '13 at 04:51

2 Answers2

1

The reason the OAUTH2 fails is because you haven't filled out the Consent Screen options. Go to your cloud dashboard then "APIs & auth" -> "Consent screen". Fill out Product Name and EMail. It takes about a minute to go through. After that the OAUTH2 should work.

Reference: https://stackoverflow.com/a/18951654/1639019

Community
  • 1
  • 1
0

Not sure if you are having the same problem I did, but there are two places where you have to change the clientid once you've generated a clientid using the developers console. One place is located inside the Constants or a variable passed into the java runtime server (development or deployment) the other is located in a file called base.js (in my hello endpoints example) located in the webapp/js folder. You must have everything configured through the developers console in order for the oauth2 redirects to work properly.

Hope this helps.

Aaron
  • 451
  • 4
  • 5