title: Access token Google+
body: <p>I'm experiencing few issues with the new-released Google+ API to retrieve an access token...</p>
  
  <p>I have been following the <a href="http://code.google.com/intl/fr/apis/accounts/docs/OAuth2.html#SS" rel="nofollow">documentation</a>, I got a Code ("4/blablabla") but when I send the POST request to get an access token, I get a "(400) Bad Request" response...</p>
  
  <p>Here is my piece of code :</p>
  
  <pre><code>// We have a request code, now we want an access token
  StringBuilder authLink = new StringBuilder();
  authLink.Append("https://accounts.google.com/o/oauth2/token");
  authLink.AppendFormat("?code={0}", gplusCode);
  authLink.AppendFormat("&amp;client_id={0}", myClientId);
  authLink.AppendFormat("&amp;client_secret={0}", mySecret);
  authLink.AppendFormat("&amp;redirect_uri={0}", myRedirectUri);
  authLink.Append("&amp;scope=https://www.googleapis.com/auth/plus.me");
  authLink.Append("&amp;grant_type=authorization_code");
  
  OAuthBase oAuth = new OAuthBase();
  string normalizedUrl, normalizedRequestParameters;
  string oAuthSignature = oAuth.GenerateSignature(new Uri(authLink.ToString()), appKey, appSecret, code, null, HttpMethod.POST.ToString(), oAuth.GenerateTimeStamp(), oAuth.GenerateNonce(), OAuthBase.SignatureTypes.HMACSHA1, out normalizedUrl, out normalizedRequestParameters);
  oAuthSignature = oAuth.UrlEncode(oAuthSignature);
  
  // Rebuild query url with authorization
  string url = string.Format("{0}?{1}&amp;oauth_signature={2}", normalizedUrl, normalizedRequestParameters, oAuthSignature);
  
  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url.ToString());
  request.Method = HttpMethod.POST.ToString();
  request.ContentType = "application/x-www-form-urlencoded";
  request.ContentLength = 0;
  
  // Send the request and get the response
  try
  {
      using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
      {
          // Do stuff ...
  </code></pre>