I am trying to generate an access_token and refresh_token to access the google spreadsheets APIs. I have used the API https://www.googleapis.com/oauth2/v3/token?code=&grant_type=authorization_code&redirect_uri=&client_id=&client_secret=&approval_prompt=force This API gives only "access_token", "type", and "expires_in" in the response and does not give a "refresh_token" How can we refresh the access token? I have tried using the API https://accounts.google.com/o/oauth2/token that needs "refresh_token" as a query parameter. I didn't find any refresh_token initially and hence was not able to hit this API. Could somebody describe the steps for obtaining a refresh_token for Spreadsheets APIs?
1 Answers
0
votes
Looks like you want to use access_type=offline
Source: https://developers.google.com/identity/protocols/OAuth2WebServer#offline