refresh the token from the API
            then call a Wallabag instance
            then store the token
        :return: wall instance
2663
def wall(self):
        
        us = UserService.objects.get(user=self.user, name='ServiceWallabag')
        params = {
            'client_id': us.client_id,
            'client_secret': us.client_secret,
            'username': us.username,
            'password': us.password,
        }
        try:
            token = Wall.get_token(host=us.host, **params)
        except Exception as e:
            update_result(self.trigger_id, msg=e, status=False)
            logger.critical('{} {}'.format(self.user, e))
            return False

        wall = Wall(host=us.host, client_secret=us.client_secret,
                    client_id=us.client_id, token=token)

        UserService.objects.filter(user=self.user,
                                   name='ServiceWallabag').update(token=token)

        return wall
589178
def update_token(self):
        """"""
        logger.info('updating token')
        if None in self.credentials.values():
            raise RuntimeError("You must provide an username and a password")
        credentials = dict(auth=self.credentials)
        url = self.test_url if self.test else self.url
        response = requests.post(url + "auth",
                                 json=credentials)
        data = response.json()["response"]
        if "error_id" in data and data["error_id"] == "NOAUTH":
            raise BadCredentials()
        if "error_code" in data and data["error_code"] == "RATE_EXCEEDED":
            time.sleep(150)
            return
        if "error_code" in data or "error_id" in data:
            raise AppNexusException(response)
        self.token = data["token"]
        self.save_token()
        return self.token
1081575
def refresh_token(self):
        """"""
        if (not self.auth_details or
                not 'refresh_token' in self.auth_details or
                not self.auth_details['refresh_token']):
            raise Exception(
                "auth_details['refresh_token'] does not contain a refresh token.")

        refresh_token = self.auth_details['refresh_token']
        params = [
            ('grant_type', 'refresh_token'),
            ('refresh_token', refresh_token)
        ]
        response = self._post('', urlencode(params),
                              CreateSend.oauth_token_uri, "application/x-www-form-urlencoded")
        new_access_token, new_expires_in, new_refresh_token = None, None, None
        r = json_to_py(response)
        new_access_token, new_expires_in, new_refresh_token = r.access_token, r.expires_in, r.refresh_token
        self.auth({
            'access_token': new_access_token,
            'refresh_token': new_refresh_token})
        return [new_access_token, new_expires_in, new_refresh_token]
1018037
def refresh(self):
        
        endpoint = '/refresh'

        payload = {
            'accessToken': self.access_token,
            'clientToken': self.client_token,
        }
        rep = self._ygg_req(endpoint, payload)
        if not rep or 'error' in rep:
            return False

        self.access_token = rep['accessToken']
        self.client_token = rep['clientToken']
        self.selected_profile = rep['selectedProfile']
        return True
647791
def access_token(self) -> str:
        
        if self._token_expires_at < time.time() + self._REFRESH_THRESHOLD:
            self.request_token()

        return self._token["access_token"]
21225
def get_refresh_token(self):
        
        try:
            credentials = OAuth2Credentials.from_json(
                self.credentials_store[g.oidc_id_token['sub']])
            return credentials.refresh_token
        except KeyError:
            logger.debug("Expired ID token, credentials missing",
                         exc_info=True)
            return None
690625
def refresh(self):
        
        res = gpsoauth.perform_oauth(
            self._email, self._master_token, self._android_id,
            service=self._scopes,
            app='com.google.android.keep',
            client_sig='38918a453d07199354f8b19af05ec6562ced5788'
        )
        if 'Auth' not in res:
            if 'Token' not in res:
                raise exception.LoginException(res.get('Error'))

        self._auth_token = res['Auth']
        return self._auth_token
255361
final protected function refreshToken()
    {
        $oldAccessToken = $this->accessToken;

        if ($this->accessToken->getRefreshToken()) {
            $this->accessToken = $this->provider->getAccessToken(self::GRANT_REFRESH_TOKEN, [
                'refresh_token' => $this->accessToken->getRefreshToken(),
            ]);
        } else {
            // request a completely new access token
            $this->accessToken = $this->requestAccessToken();
        }

        if ($this->refreshTokenCallback) {
            call_user_func($this->refreshTokenCallback, $this->accessToken, $oldAccessToken);
        }
    }
209500
def refresh_oauth_token(self, keychain):
        
        if hasattr(self, "_scratch_info"):
            # Cache the scratch_info for 1 hour to avoid unnecessary calls out
            # to sfdx CLI
            delta = datetime.datetime.utcnow() - self._scratch_info_date
            if delta.total_seconds() > 3600:
                del self._scratch_info

                # Force a token refresh
                self.force_refresh_oauth_token()

        # Get org info via sfdx force:org:display
        self.scratch_info
        # Get additional org info by querying API
        self._load_orginfo()
1169007
def reload(self):
        
        try:
            if hasattr(self, 'href'):
                data = self._api.get(self.href, append_base=False).json()
                resource = self.__class__(api=self._api, **data)
            elif hasattr(self, 'id') and hasattr(self, '_URL') and \
                    'get' in self._URL:
                data = self._api.get(
                    self._URL['get'].format(id=self.id)).json()
                resource = self.__class__(api=self._api, **data)
            else:
                raise SbgError('Resource can not be refreshed!')

            query = {'id': self.id} if hasattr(self, 'id') else {}
            extra = {'resource': self.__class__.__name__, 'query': query}
            logger.info('Reloading {} resource.'.format(self), extra=extra)

        except Exception:
            raise SbgError('Resource can not be refreshed!')

        self._data = resource._data
        self._dirty = resource._dirty
        self._old = copy.deepcopy(self._data.data)
        return self
178257
def refresh_session(self):
        

        if not self._refresh_token:
            if self._username and self._password:
                return self.login(self._username, self._password)

            return

        return self._authenticate(
            grant_type='refresh_token',
            refresh_token=self._refresh_token,
            client_id=self._client_id,
            client_secret=self._client_secret
        )
509431
public function refresh()
    {
        $this->expires_at = Carbon::now()->addMonth();
        $this->token = str_random(60);
        $this->save();
    }
549442
def refresh(self):
        
        uri = "%s/%s" % (self.uri, "refresh")
        response, instance = self.request("GET", uri)
        return response.ok
1095950
def refresh(self):
        
        r = fapi.get_workspace(self.namespace, self.name, self.api_url)
        fapi._check_response_code(r, 200)
        self.data = r.json()
        return self
399983
def refresh_token(token_service, refresh_token, client_id, client_secret):
  """"""
  data = {
    'client_id': client_id,
    'client_secret': client_secret,
    'refresh_token': refresh_token,
    'grant_type': 'refresh_token',
  }
  resp = requests.post(token_service, data)
  print resp, 'refreshing', resp.json()
  return resp.json()
1282090
async def refresh_pool_ledger(handle: int) -> None:
    

    logger = logging.getLogger(__name__)
    logger.debug("refresh_pool_ledger: >>> config_name: %r",
                 handle)

    if not hasattr(refresh_pool_ledger, "cb"):
        logger.debug("refresh_pool_ledger: Creating callback")
        refresh_pool_ledger.cb = create_cb(CFUNCTYPE(None, c_int32, c_int32))

    c_handle = c_int32(handle)

    res = await do_call('indy_refresh_pool_ledger',
                        c_handle,
                        refresh_pool_ledger.cb)

    logger.debug("refresh_pool_ledger: <<< res: %r", res)
    return res
529562
def refresh(params = {}, access_token_opts = {}, access_token_class = self.class)
      raise('A refresh_token is not available') unless refresh_token
      params[:grant_type] = 'refresh_token'
      params[:refresh_token] = refresh_token
      new_token = @client.get_token(params, access_token_opts, access_token_class)
      new_token.options = options
      new_token.refresh_token = refresh_token unless new_token.refresh_token
      new_token
    end