title: UserService.getCurrentUser() returns null
body: <p>I have implemented 3-legged OAuth using Google OAuth API in Java.</p>
  
  <p>My application is registered on GAE. And, I am successfully getting the access token as well. But, now when I am creating the object of UserService, even if I am logged in Gmail as well as my personal domain mail, it returns null while calling getCurrentUser() !</p>
  
  <p>My code is : </p>
  
  <pre><code>import com.google.appengine.api.users.UserService;
  import com.google.appengine.api.users.UserServiceFactory;
  
      oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
      oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
      oauthParameters.setScope("https://spreadsheets.google.com/feeds/");
      oauthParameters.setOAuthType(OAuthParameters.OAuthType.THREE_LEGGED_OAUTH);
      oauthParameters.setOAuthToken(request.getSession().getAttribute("oauth_token").toString());
      oauthParameters.setOAuthTokenSecret(request.getSession().getAttribute("oauth_token_secret").toString());
  
  UserService userService = UserServiceFactory.getUserService();
  out.println("&lt;br/&gt;Get Current User : " + userService.getCurrentUser());
  </code></pre>
  
  <p>There is no need to specifically add any jar while using User Service. Then what is the problem here ?</p>
  
  <p>Also when I try this : </p>
  
  <pre><code>out.println(userService.isUserLoggedIn() ? "User is Logged In" : "User is Log Off");
  </code></pre>
  
  <p>It outputs : </p>
  
  <blockquote>
    <p>User is Log Off  </p>
  </blockquote>
  
  <p>while I am login to my personal domain &amp; gmail both ! I think, this should probably redirect me to login page in case if I am sign off. But, it doesn't !</p>
  
  <p>Also, as per it given <a href="http://code.google.com/intl/it-IT/appengine/docs/java/oauth/overview.html" rel="nofollow">here</a> &amp; in systempuntout Answer, if I try :</p>
  
  <pre><code>OAuthService oauth = OAuthServiceFactory.getOAuthService();
  User user = oauth.getCurrentUser();
  out.println("&lt;br/&gt;Get Current User : " + user.getNickname());
  </code></pre>
  
  <p>Still, it stops the execution ! :(</p>
  
  <p>I am getting following error in Google App Engine Log : </p>
  
  <pre><code>Oauth.requestServlet doGet: null
  com.google.appengine.api.oauth.InvalidOAuthParametersException: Unknown
      at com.google.appengine.api.oauth.OAuthServiceImpl.makeSyncCall(OAuthServiceImpl.java:73)
      at com.google.appengine.api.oauth.OAuthServiceImpl.getGetOAuthUserResponse(OAuthServiceImpl.java:53)
      at com.google.appengine.api.oauth.OAuthServiceImpl.getCurrentUser(OAuthServiceImpl.java:28)
      at Oauth.accessFeeds.access(accessFeeds.java:60)
      at Oauth.requestServlet.processRequest(requestServlet.java:129)
      at Oauth.requestServlet.doGet(requestServlet.java:199)
  </code></pre>
  
  <p>For reference : <a href="http://code.google.com/appengine/docs/java/gettingstarted/usingusers.html" rel="nofollow">Using the Users Service</a>
  For APIs : <a href="http://code.google.com/intl/it-IT/appengine/docs/java/javadoc/com/google/appengine/api/oauth/package-summary.html" rel="nofollow">com.google.appengine.api.oauth</a>, <a href="http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/users/package-summary.html" rel="nofollow">com.google.appengine.api.users</a></p>
  
  <p>Is it (least possible) bug with Google OAuth ?</p>