Created
March 30, 2015 10:27
-
-
Save kelvinn/87d6b91649d4366c15eb to your computer and use it in GitHub Desktop.
Resolving Android authenticated calls to Google Cloud Endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ApiMethod(name = "sayHi") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.