Ответ 1
Используйте игровую площадку Google OAuth:
https://developers.google.com/oauthplayground/
Запрос:
POST /oauth2/v3/token HTTP/1.1
Host: www.googleapis.com
Content-Type: application/x-www-form-urlencoded
code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7&
client_id=8819981768.apps.googleusercontent.com&
client_secret={client_secret}&
redirect_uri=https://oauth2-login-demo.appspot.com/code&
grant_type=authorization_code
(Успешный) Ответ:
{
"access_token":"1/fFAGRNJru1FTz70BzhT3Zg",
"expires_in":3920,
"token_type":"Bearer"
}
Я также очень рекомендую прочитать документацию Google OAuth 2.0 https://developers.google.com/accounts/docs/OAuth2WebServer