Internal: Revokes the refresh token and corresponding access tokens.

 Returns nothing.

 Raises Cronofy::CredentialsMissingError if no credentials available.
175369
def revoke!
      raise CredentialsMissingError.new("No credentials to revoke") unless access_token

      do_request do
        body = {
          client_id: @api_client.id,
          client_secret: @api_client.secret,
          token: access_token.refresh_token || access_token.token,
        }

        @api_client.request(:post, "/oauth/token/revoke", body: body)
        @access_token = nil
      end
    end
1320262
def revoke_token(access_token):
    
    response = requests.post(
        get_revoke_token_url(),
        data={
            'token': access_token,
            'client_id': settings.API_CLIENT_ID,
            'client_secret': settings.API_CLIENT_SECRET,
        },
        timeout=15
    )
    return response.status_code == 200
439582
private function revokeTokens()
    {
        $revocations = array_filter([
            'refresh_token' => $this->session->get('refreshToken'),
            'access_token' => $this->session->get('accessToken'),
        ]);
        $url = uri_for($this->config['accounts'])
            ->withPath($this->config['revoke_url'])
            ->__toString();
        foreach ($revocations as $type => $token) {
            $this->getClient()->request('post', $url, [
                'form_params' => [
                    'token' => $token,
                    'token_type_hint' => $type,
                ],
            ]);
        }
    }
513011
def renew_access_token(self):
        
        auth_params = {'REFRESH_TOKEN': self.refresh_token}
        self._add_secret_hash(auth_params, 'SECRET_HASH')
        refresh_response = self.client.initiate_auth(
            ClientId=self.client_id,
            AuthFlow='REFRESH_TOKEN',
            AuthParameters=auth_params,
        )

        self._set_attributes(
            refresh_response,
            {
                'access_token': refresh_response['AuthenticationResult']['AccessToken'],
                'id_token': refresh_response['AuthenticationResult']['IdToken'],
                'token_type': refresh_response['AuthenticationResult']['TokenType']
            }
        )
662544
def refresh_token(token, session=None):
    
    session = session or HTTP_SESSION
    refresh_data = dict(
        refresh_token=token.refresh_token,
        client_id=token.consumer_key,
        client_secret=token.consumer_secret,
        grant_type='refresh_token'
    )
    resp = session.post(REFRESH_TOKEN_URL, data=refresh_data)
    resp_json = resp.json()
    if 'error' in resp_json:
        message = resp_json['error']
        description = resp_json.get('error_description', '')
        if any(description):
            message = u'{}: {}'.format(message, description)
        raise OAuthTokenExpiredError(message)
    return OAuthToken(
        access_token=resp_json['access_token'],
        refresh_token=token.refresh_token,
        consumer_key=token.consumer_key,
        consumer_secret=token.consumer_secret
    )
248435
def revoke_user_access( self, access_id ):
        '''
            
        ''' 
        path = "/api/v3/publisher/user/access/revoke"

        data = {
            'api_token': self.api_token, 
            'access_id': access_id,
        }

        r = requests.get( self.base_url + path, data=data )

        if r.status_code != 200:
            raise ValueError( path + ":" + r.reason )
1324736
def refresh_access_token(self):
        
        if self.client_secret is None:
            raise Exception("client_secret must be set to execute "
                            "refresh_access_token.")
        if self.refresh_token is None:
            raise Exception("refresh_token must be set to execute "
                            "refresh_access_token.")
        params = {'client_id': self.client_id,
                  'client_secret': self.client_secret,
                  'grant_type': 'refresh_token',
                  'refresh_token': self.refresh_token}
        result = self._send_request(REFRESH_URL.format(self._base_url),
                                    params=params, method='POST',
                                    data_field=None)
        self.access_token = result['access_token']
        return self.access_token
759881
def stop_refreshing_token(self):
        
        with self.lock:
            self.timer_stopped = True
            self.timer.cancel()
395510
public void revokeToken() {

        URL url = null;
        try {
            url = new URL(this.revokeURL);
        } catch (MalformedURLException e) {
            assert false : "An invalid refresh URL indicates a bug in the SDK.";
            throw new RuntimeException("An invalid refresh URL indicates a bug in the SDK.", e);
        }

        String urlParameters = String.format("token=%s&client_id=%s&client_secret=%s",
                this.accessToken, this.clientID, this.clientSecret);

        BoxAPIRequest request = new BoxAPIRequest(this, url, "POST");
        request.shouldAuthenticate(false);
        request.setBody(urlParameters);

        try {
            request.send();
        } catch (BoxAPIException e) {
            throw e;
        }
    }
218083
def refresh(self, client_name, refresh_token, **params):
        
        client = self.client(client_name, logger=self.app.logger)
        return client.get_access_token(refresh_token, grant_type='refresh_token', **params)
1275130
def revoke_token
      # entry point
      url = "#{@client.app_info[:launcher_server]}#{API_VERSION}/auth"

      # api call
      uri = URI(url)
      http = Net::HTTP.new(uri.host, uri.port)
      req = Net::HTTP::Delete.new(uri.path, {
        'Authorization' => "Bearer #{@client.key_helper.get_valid_token()}"
      })
      res = http.request(req)
      res.code == "200"
    end
1236233
async def revoke(client: Client, revocation_signed_raw: str) -> ClientResponse:
    
    return await client.post(MODULE + '/revoke', {'revocation': revocation_signed_raw}, rtype=RESPONSE_AIOHTTP)
1275395
def revoke(self, token_id, *args, **kwargs):
        

        return self.delete(token_id, *args, **kwargs)
363051
def logout(self, refresh_token):
        
        return self._realm.client.post(self.get_url('end_session_endpoint'),
                                       data={
                                           'refresh_token': refresh_token,
                                           'client_id': self._client_id,
                                           'client_secret': self._client_secret
                                       })
905724
def revoke_oauth_credential(self):
        """"""
        if self.session.token_type == auth.SERVER_TOKEN_TYPE:
            return

        credential = self.session.oauth2credential
        revoke_access_token(credential)
1294581
def _convert_credentials(token_url, username=None, password=None, refresh_token=None):
    
    if username and password:
        data = {'grant_type': 'password', 'username': username, 'password': password}
    elif refresh_token:
        data = {'grant_type': 'refresh_token', 'refresh_token': refresh_token}
    else:
        raise NotImplementedError()

    response = requests.post(token_url, data=data)
    if response.status_code == 401:
        raise Unauthorized('401 Client Error: Unauthorized')
    elif response.status_code == 200:
        d = response.json()
        expiry = datetime.utcnow() + timedelta(seconds=d['expires_in'])
        return Credentials(access_token=d['access_token'],
                           refresh_token=d['refresh_token'],
                           expiry=expiry)
    else:
        raise YamcsError('{} Server Error'.format(response.status_code))
185148
async def revoke(self, schemaId: ID, i):
        
        acc, ts = await self._nonRevocationIssuer.revoke(schemaId, i)
        await self.wallet.submitAccumUpdate(schemaId=schemaId, accum=acc,
                                            timestampMs=ts)