I have completed steps of authorization and obtained access token and refresh token.
What should I do next to generate access token using refresh token that I have s
POST /oauth2/v4/token
Host: www.googleapis.com
Headers
Content-length: 163
content-type: application/x-www-form-urlencoded
RequestBody
client_secret=************&grant_type=refresh_token&refresh_token=sasasdsa1312dsfsdf&client_id=************
Using ASP.Net Post call, this worked for me.
StringBuilder getNewToken = new StringBuilder();
getNewToken.Append("https://www.googleapis.com/oauth2/v4/token");
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(getNewToken.ToString());
var values = new Dictionary<string, string>
{
{ "client_id", <Your Client Id> },
{ "client_secret", <Your Client Secret> },
{ "refresh_token", <Your Saved Refresh Token> },
{ "grant_type", "refresh_token"}
};
var content = new FormUrlEncodedContent(values);
var response = await client.PostAsync(getNewToken.ToString(), content);