Using Auth with Endpoints <p>I defined a simple API using Google Cloud Endpoints:</p> <pre><code>@Api(name = "realestate", version = "v1", clientIds = { com.google.api.server.spi.Constant.API_EXPLORER_CLIENT_ID }, scopes = { "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile" }) public class RealEstatePropertyV1 { @ApiMethod(name = "create", path = "properties", httpMethod = HttpMethod.POST) public void create(RealEstateProperty property, User user) throws UnauthorizedException { if (user == null) { throw new UnauthorizedException("Must log in"); } System.out.println(user.getEmail()); } } </code></pre> <p>Then I try to test it using the <code>API explorer</code>. I activated OAuth 2.0. But when I execute the request, the <code>User</code> object is <code>null</code>.</p> <pre><code>Jun 23, 2013 10:21:50 AM com.google.appengine.tools.development.DevAppServerImpl start INFO: Dev App Server is now running Jun 23, 2013 10:22:42 AM com.google.api.server.spi.SystemServiceServlet init INFO: SPI restricted: true Jun 23, 2013 10:22:43 AM com.google.api.server.spi.WebApisUserService getCurrentUser WARNING: getCurrentUser: clientId not allowed Jun 23, 2013 10:22:43 AM com.google.api.server.spi.SystemService invokeServiceMethod INFO: cause={0} com.google.api.server.spi.response.UnauthorizedException: Must log in at com.realestate.api.v1.RealEstatePropertyV1.create(RealEstatePropertyV1.java:44) </code></pre>