0

I want to protect my endpoint. Only allow my android app use this endpoint method. How can i archive this purpose?. I don't want to ask user to provide credential.

I did provide the clientids. But look like the User parameter on backend is always null. I'm following this instruction. https://cloud.google.com/appengine/docs/java/endpoints/getstarted/backend/code_walkthrough#oauth_protecting_a_method

Thank you so much.

Vui Viet
  • 1
  • 1
  • Are you still experiencing this issue? I was having the same behaviour of a null User object no matter what, but it has recently and magically fixed. – Nick Jan 27 '15 at 21:12

1 Answers1

0

I believe this is a known issue, and soon the User object will populate properly, but for now, you can use the following workaround to get a valid User object:

OAuthService oauth = OAuthServiceFactory.getOAuthService();
user = oauth.getCurrentUser();

This is based on the comment in the public issue tracker thread for a related issue here.

Nick
  • 3,581
  • 1
  • 14
  • 36