Google API - OAuth 2.0 - Get AccessToken and Refresh Token Part-1

Опубликовано: 24 Декабрь 2019
на канале: OpenSourceAutomation - Afsar Ali
119,236
854

URL: https://developers.google.com/identit...
https://developers.google.com/identit...
Please watch all video related to Gmail Automation :   • Google API - Automation ,Gmail,GDrive...  

1.Get code :
https://accounts.google.com/o/oauth2/...
scope=https://mail.google.com&
access_type=offline&
redirect_uri=http://localhost&
response_type=code&
client_id=[Client ID]

2. Get access_token and refresh_token
curl \
--request POST \
--data "code=[Authentcation code from authorization link]&client_id=[Application Client Id]&client_secret=[Application Client Secret]&redirect_uri=http://localhost&grant_type=authorization_code" \
https://accounts.google.com/o/oauth2/...

3.Get new access_token using refresh_token
curl \
--request POST \
--data "client_id=[your_client_id]&client_secret=[your_client_secret]&refresh_token=[refresh_token]&grant_type=refresh_token" \
https://accounts.google.com/o/oauth2/...