Skip to content

Instantly share code, notes, and snippets.

@kelvinn
Created March 30, 2015 10:27
Show Gist options
  • Save kelvinn/87d6b91649d4366c15eb to your computer and use it in GitHub Desktop.
Save kelvinn/87d6b91649d4366c15eb to your computer and use it in GitHub Desktop.
Resolving Android authenticated calls to Google Cloud Endpoint
@ApiMethod(name = "sayHi", clientIds = {
Constants.WEB_CLIENT_ID,
Constants.ANDROID_CLIENT_ID},
audiences = { Constants.WEB_CLIENT_ID, Constants.ANDROID_CLIENT_ID },
scopes = {
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile" })
@ApiMethod(name = "sayHi")
@kelvinn
Copy link
Author

kelvinn commented Mar 30, 2015

I was having problems authenticating Android to the Endpoint example. Because the API worked from the API Explorer I thought it was something on the Android side, however, it wasn't... I needed to add the scopes to the ApiMethod annotation. There were no errors to say what was going on, and I'm finding Google Cloud Endpoint to be rather hard to debug if something isn't working. Either way - I thought I would post this somewhere for somebody to maybe find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment