Revokes the access and refresh tokens saved in the session.

@see Connector::logOut()

@throws \GuzzleHttp\Exception\GuzzleException
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,
                ],
            ]);
        }
    }
1216506
public function revokeAccessToken()
    {
        $grantType = $this->getRequest()->request->get('grant_type') ? $this->getRequest()->request->get('grant_type') : 'password';
        $token = $this->getRequest()->request->get('token');
        if (is_null($token)) {
            throw new Exception\InvalidRequestException('token');
        }
        $token_type_hint = $this->getRequest()->request->get('token_type_hint');
        if (! is_null($token_type_hint) && $token_type_hint == 'refresh_token') {
            $authorization = ! empty(Request::header()['authorization'][0]) ? str_replace('Bearer ','', Request::header()['authorization'][0]) : null;
            if (is_null($authorization)) {
                throw new Exception\InvalidRequestException('access_token');
            }
        }
        // Ensure grant type is one that is recognised and is enabled
        if (!in_array($grantType, array_keys($this->grantTypes))) {
            throw new Exception\UnsupportedGrantTypeException($grantType);
        }
        if ($grantType != 'password' && $grantType != 'refresh_token') {
            throw new Exception\UnsupportedRevokeTypeException;
        }
        // Complete the flow

        return $this->getGrantType($grantType)->revokeFlow();
    }
718444
public function logoutAction() {
        // never cache the logout request
        $this->_helper->cache->setNoCacheHeaders($this->getResponse());

        $auth = Garp_Auth::getInstance();
        $userData = $auth->getUserData();
        $this->_beforeLogout($userData);

        $auth->destroy();
        $authVars = $auth->getConfigValues();
        $target = '/';
        if ($authVars && !empty($authVars['logout']['successUrl'])) {
            $target = $authVars['logout']['successUrl'];
        }

        // Remove the role cookie
        if (!$auth->getStore() instanceof Garp_Store_Cookie) {
            $this->_removeRoleCookie();
        }

        $this->_afterLogout($userData);

        $flashMessenger = $this->_helper->getHelper('FlashMessenger');
        $flashMessenger->addMessage(__($authVars['logout']['successMessage']));

        $cacheBuster = 'action=logout';
        $target .= (strpos($target, '?') === false ? '?' : '&') . $cacheBuster;
        $this->_helper->viewRenderer->setNoRender(true);
        $this->_redirect($target);
    }
1170463
public function logout()
	{
		$acct = $this->acct();

		// If we have an event dispatcher instance, we can fire off the logout event
		// so any further processing can be done. This allows the developer to be
		// listening for anytime a acct signs out of this application manually.
		$this->clearAcctDataFromStorage();

		if ( !is_null( $this->acct ) )
			$this->refreshRememberToken( $acct );

		Hooks::trigger( 'acct.logout', compact( 'acct' ) );

		// Once we have fired the logout event we will clear the accts out of memory
		// so they are no longer available as the acct is no longer considered as
		// being signed into this application and should not be available here.
		$this->acct = null;
		$this->loggedOut = true;
	}
155129
public function logout()
    {
        if ($this->check()) {
            $this->matrix()->request('POST', $this->endpoint('logout'), [], [
                'access_token' => $this->data['access_token']
            ]);
            $this->setData(null);
            return true;
        }
        throw new \Exception('Not authenticated');
    }
1358811
public function logout(): void
    {
        Internal\Cookies::setList(Internal\Cookies::TYPE_SERVER, [
            ['name' => '_s', 'value' => 'deleted', 'expire' => 0],
            ['name' => '_a', 'value' => 'deleted', 'expire' => 0]
        ]);
        self::$cache = [];
    }
1301689
public static function disconnect() :void {

		// first authenticate
		self::enforce();

		// then close the session
		self::$_account->closeSession();

		// and redirect to the exit route or fallback to the login route
		Response::setRedirect(Config::get('router', 'exit_route') ?: Config::get('router', 'login_route'));

		// render the response
		Response::render();

	}
565719
def logout(self):
        
        # Remove token from local cache
        # MAINT: need to expire token on server
        data = self._read_uaa_cache()
        if self.uri in data:
            for client in data[self.uri]:
                if client['id'] == self.client['id']:
                    data[self.uri].remove(client)

        with open(self._cache_path, 'w') as output:
            output.write(json.dumps(data, sort_keys=True, indent=4))
228125
def logout(self):
        """"""
        if self._logged_in is True:
            self.si.flush_cache()
            self.sc.sessionManager.Logout()
            self._logged_in = False
154649
public function logout()
	{
		// Build the request path.
		$path = '?action=login';

		// @todo clear internal data as well

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}
453028
def logout
      auth_token = get_connection_object.headers['X-Auth-Token']
      raise "Can't find any authorization token to logout." unless auth_token
      @response = delete("/auth/#{auth_token}")
      if @response.has_key?("success") and @response['success']
        get_connection_object.headers.delete("X-Auth-Token")
      end
      @response
    end
772547
public function logoutAction()
    {
        if ($this->isAuthenticated()) {
            $this->session()->set('user', null);
        }

        $this->setMessage('success', 'Bye Bye !');
        return $this->redirect('/');
    }
146167
public function logout()
    {
        // Unset authenticated session
        $security = $this->container->accessHandler;
        $security->endAuthenticatedSession();

        // Unset CSRF Token
        $csrfGuard = $this->container->csrfGuard;
        $csrfGuard->unsetToken();

        return $this->redirect('home');
    }
228680
public function logout($redirect = '/', $token = null)
    {
        $current_token = $token ?: $this->parseToken();

        if ( $redirect and $current_token )
        {
            $this->session->forget('googleapi_token');

            $this->client->revokeToken($current_token);

            return $this->redirect->to($redirect);
        }

        return false;
    }
670607
public function logout()
	{
		$this->user = null;

		$this->session->forget();
		$this->cookie->forget();
	}
677716
def revoke_session(self, sid='', token=''):
        
        if not sid:
            if token:
                sid = self.handler.sid(token)
            else:
                raise ValueError('Need one of "sid" or "token"')

        for typ in ['access_token', 'refresh_token', 'code']:
            try:
                self.revoke_token(self[sid][typ], typ)
            except KeyError:  # If no such token has been issued
                pass

        self.update(sid, revoked=True)
70239
public function revokeAccessToken()
    {
        //Access Token
        $accessToken = $this->getApp()->getAccessToken();

        //Request
        $request = new DropboxRequest("POST", "/auth/token/revoke", $accessToken);
        // Do not validate the response
        // since the /token/revoke endpoint
        // doesn't return anything in the response.
        // See: https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke
        $request->setParams(['validateResponse' => false]);

        //Revoke Access Token
        $this->getClient()->sendRequest($request);
    }