title: 400 Error "error_description" : "Invalid grant_type: urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer" Google Service account
body: <p>I am following this tutorial 
  <a href="https://developers.google.com/accounts/docs/OAuth2ServiceAccount" rel="nofollow">https://developers.google.com/accounts/docs/OAuth2ServiceAccount</a>
  to authorise my application.  i have created a JWT by following the tutorial. </p>
  
  <p>But when I make a access token request I keep on getting a 
  "Invalid grant_type: urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer" exception.</p>
  
  <p>Here is my code to make the request</p>
  
  <pre><code>HttpClient httpClient = new HttpClient();
          PostMethod post = new PostMethod("https://accounts.google.com/o/oauth2/token");
          post.addRequestHeader("Content-Type", "application/x-www-form-urlencoded");
          post.addParameter("grant_type", URLEncoder.encode("urn:ietf:params:oauth:grant-type:jwt-bearer", "UTF-8"));
          post.addParameter("assertion", "JWT including signature.");
          httpClient.executeMethod(post);
  </code></pre>
  
  <p>I have looked at a lot of resources bu the obvious error seems to be mistaking the client id for the email id.  However, I have checked and re-cheeked that to make sure that I am using the correct one. </p>
  
  <p>Please can anyone tell me what am I doing wrong. </p>
  
  <p>Many Thanks</p>