xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Get Authorization code:
Request:
https://accounts.google.com/o/oauth2/v2/auth
?redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground
&prompt=consent
&response_type=code
&client_id=407408718192.apps.googleusercontent.com
&scope=https%3A%2F%2Fmail.google.com
&access_type=offline
Response:
GET /oauthplayground/
?code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
&scope=https://mail.google.com HTTP/1.1
Host: developers.google.com
Get Accesstoken:
Request:
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 277
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground
&client_id=407408718192.apps.googleusercontent.com
&client_secret=************
&scope=
&grant_type=authorization_code
Response:
HTTP/1.1 200 OK
Content-length: 583
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: Fri, 15 Mar 2019 06:36:45 GMT
X-frame-options: SAMEORIGIN
Alt-svc: quic=":443"; ma=2592000; v="46,44,43,39"
Content-type: application/json; charset=utf-8
{
"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"scope": "https://www.googleapis.com/auth/gmail",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}