title: OAuth: Send Access Token and Get User data
body: <p>I am trying Google OAuth.I am developing web application running on IBM webSphere server. Application's framework is SpringMVC.</p>
  
  <p>I am trying to get userinfo.profile. I have <strong>successfully get Access Token</strong> and could not find a way to use this token and get user information.</p>
  
  <p>I was redirecting browser to this URL <code>https://www.googleapis.com/oauth2/v2/userinfo?access_token="+access.getAccessToken();</code> but getting error</p>
  
  <pre><code>{
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "authError",
      "message": "Invalid Credentials",
      "locationType": "header",
      "location": "Authorization"
     }
    ],
    "code": 401,
    "message": "Invalid Credentials"
   }
  }
  </code></pre>
  
  <p>Am I using this access token fine or should I send request in some other form?</p>
  
  <p>I am sending request in this way:</p>
  
  <pre><code>GenericUrl shortenEndpoint = new GenericUrl("https://www.googleapis.com/oauth2/v2/userinfo");
  HttpRequest request1 = rf.buildGetRequest(shortenEndpoint);
  GoogleHeaders headers = new GoogleHeaders();
  headers.setContentType("application/json; charset=UTF-8");
  headers.setAuthorization("OAuth " + accessToken); 
  request1.setHeaders(headers);
  HttpResponse shortUrl = request1.execute();
  </code></pre>
  
  <p>After giving my Access Token in this URL in browser</p>
  
  <pre><code>https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=******
  </code></pre>
  
  <p>I got </p>
  
  <pre><code>{
   "issued_to": "*****************",
   "audience": "*****************",
   "scope": "https://www.googleapis.com/auth/urlshortener",
   "expires_in": 3515,
   "access_type": "online"
  }
  </code></pre>