title: How do I test Cloud Endpoints with Oauth on devserver
body: <p>My app uses Oauthed Cloud Endpoints and is working fine in production. </p>
  
  <p>My problem is that on the local devserver, my User user is always set to <strong>example@example.com</strong>, even though I've gone through the usual auth, access code, etc etc etc and have a valid authed user.</p>
  
  <p>I get that example@example.com is useful to test oauth endpoints before I have oauth working properly, but since my app is working I'd rather see the actual user there. </p>
  
  <p>To be specific, my endpoint method is </p>
  
  <pre><code>@ApiMethod(name = "insertEmp"), etc
  public Emp insertEmp(User user, Emp emp) {
        System.out.println(user.getEmail());  // (A) log "appengine" email
        System.out.println(OAuthServiceFactory.getOAuthService().getCurrentUser().getEmail(); // (B) log authed email
  
         ...
  </code></pre>
  
  <p>When deployed, everything is fine, and both (A) and (B) log the authenticated user (my.email@gmail.com).</p>
  
  <p>When testing on my local devserver, (A) always logs "example@example.com", even though I have gone through the Oauth sequence and have a valid, authenticated user, and (B) logs my.email@gmail.com. So I can do hi-fidelity testing, I need the User to be the real authenticated user.</p>
  
  <p><strong>So in simple terms, how do I get (A) and (B) to be the same?</strong></p>