0
votes

I am not sure why i am getting this error message. i have inserted the ids

POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 322
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground

HTTP/1.1 400 Bad Request Content-length: 68 X-xss-protection: 1; mode=block X-content-type-options: nosniff Transfer-encoding: chunked Vary: Origin, X-Origin, Referer Server: ESF -content-encoding: gzip Cache-control: private Date: Sun, 11 Nov 2018 23:59:34 GMT X-frame-options: SAMEORIGIN Alt-svc: quic=":443"; ma=2592000; v="44,43,39,35" Content-type: application/json; charset=utf-8

{
  "error_description": "Bad Request", 
  "error": "invalid_grant"
}
1
please edit your question to explain the steps you have taken to get to the moment you see this error. - pinoyyid
Include the data in the HTTP body section. As the error states your grant request is not valid. grant_type will look like grant_type: urn:ietf:params:oauth:grant-type:jwt-bearer or grant_type: refresh_token before encoding. The first is for requesting an access token the second for renewing an existing access token with a refresh token. - John Hanley

1 Answers

0
votes

Bad Request error occurs when the request syntax are wrong (i.e. when a parameter or a header you are supposed to send is missing or contains an incorrect/invalid value). Best option is to check OAuth Specification are figure out what you have done wrong in the token request. Google might have a slightly different implementation from the actual specification, but I think it won't be difficult to find the issue after checking the documentation.

Access token request specification for authorization code grant can be found here.