title: Google oAuth2 unauthorized_client by refresh_token
body: <p>i'm trying to use an refresh token from the oAuth2 web redirect auth in my console perl script. The client id is the same and correct client id i used in my javascript an i checked it 5 times that it ist the same as i have in my google API's Console.</p>
  
  <p>The client secret is checked two and it is correct.</p>
  
  <p>The refresh token was created with <code>approval_prompt=force&amp;access_type=offline</code></p>
  
  <p>Here is my perl sample code i use:</p>
  
  <pre><code># -----------------------------------------------------------------------------------
  my $CLIENT_ID     = 'XXXXX.apps.googleusercontent.com';
  my $CLIENT_SECRET = 'YYYYYYYYYYY';
  # -----------------------------------------------------------------------------------
  # TESTING
  my $refresh_token = '1/is_5_minutes_old';
  # -----------------------------------------------------------------------------------
  
  my $string = '';
  $string .= 'grant_type=refresh_token';
  $string .= '&amp;client_id=' . $CLIENT_ID;
  $string .= '&amp;client_secret=' . $CLIENT_SECRET;
  $string .= '&amp;refresh_token=' . $refresh_token;
  
  $ua = LWP::UserAgent-&gt;new;
  
  my $req =
    HTTP::Request-&gt;new( POST =&gt; 'https://accounts.google.com/o/oauth2/token' );
  $req-&gt;content_type('application/x-www-form-urlencoded');
  $req-&gt;content($string);
  print $string . "\n";
  my $res = $ua-&gt;request($req);
  print $res-&gt;as_string;
  </code></pre>
  
  <p>The response of it:</p>
  
  <pre><code>HTTP/1.1 400 Bad Request
  Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  Connection: close
  Date: Mon, 02 Sep 2013 10:50:26 GMT
  Pragma: no-cache
  Server: GSE
  Content-Type: application/json
  Expires: Fri, 01 Jan 1990 00:00:00 GMT
  Alternate-Protocol: 443:quic
  Client-Date: Mon, 02 Sep 2013 10:50:26 GMT
  Client-Peer: 74.125.136.84:443
  Client-Response-Num: 1
  Client-SSL-Cert-Issuer: /C=US/O=Google Inc/CN=Google Internet Authority G2
  Client-SSL-Cert-Subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=accounts.google.com
  Client-SSL-Cipher: RC4-SHA
  Client-SSL-Warning: Peer certificate not verified
  X-Content-Type-Options: nosniff
  X-Frame-Options: SAMEORIGIN
  X-XSS-Protection: 1; mode=block
  
  {
    "error" : "unauthorized_client"
  }
  </code></pre>
  
  <p>i hope you have an idea to help.</p>
  
  <p>greatings</p>