I want to get the access token from Google. The Google API says that to get the access token, send the code and other parameters to token generating page, and the response
Using offline access and prompt:consent worked well to me:
auth2 = gapi.auth2.init({ client_id: '{cliend_id}' }); auth2.grantOfflineAccess({prompt:'consent'}).then(signInCallback);