def RefreshGoogleAccessToken(self, client, callback):
    def _OnRefresh(response):
      try:
        response_dict = www_util.ParseJSONResponse(response)
      except web.HTTPError as e:
        if e.status_code == 400:
          logging.error('%s: failed to refresh access token; clearing refresh token' % e)
          with util.ExceptionBarrier(util.LogExceptionCallback):
            self.refresh_token = None
            self.Update(client, util.NoCallback)
        raise

      self.access_token = response_dict['access_token']
      self.expires = time.time() + response_dict['expires_in']
      callback()

    body = urllib.urlencode({'refresh_token': self.refresh_token,
                             'client_id': secrets.GetSecret('google_client_id'),
                             'client_secret': secrets.GetSecret('google_client_secret'),
                             'grant_type': 'refresh_token'})
    http_client = httpclient.AsyncHTTPClient()
    http_client.fetch(Identity._GOOGLE_REFRESH_URL, method='POST', callback=_OnRefresh, body=body)
Refreshes an expired google access token using the refresh token.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/identity.py/Identity.RefreshGoogleAccessToken