Revoke the refresh token.

@param string $tokenId
@throws \Exception
194792
public function revokeRefreshToken($tokenId)
    {
        $this->getEntityManager()->transactional(function(EntityManagerInterface $em) use ($tokenId) {
            $token = $this->find($tokenId);

            if ($token) {
                $em->remove($token);
            }
        });
    }
1073007
public function delete(RefreshTokenEntity $token)
    {
        $this->getConnection()->table('oauth_refresh_tokens')
        ->where('id', $token->getId())
        ->delete();
    }
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();
    }
1079990
public function getToken($tokenId)
    {
        $tracker = $this->loader->getTracker();
        $token = $tracker->getToken($tokenId);
        return $token;
    }
138848
def revoke_token(self, subid):
    ''''''
    from expfactory.database.models import Participant
    p = Participant.query.filter(Participant.id == subid).first()
    if p is not None:
        p.token = 'revoked'
    self.session.commit()
    return p
598264
def revoke_tokens(self):
        

        self.is_active = False
        self.save()

        self.refresh_token.revoke_tokens()
848345
public function forget(string $token): void
    {
        $this->cache->forget($this->getCacheKey($token));
    }
363339
protected function unsetRefreshToken($refreshToken)
    {
        if (null !== $token = $this->app['repo.api-oauth-refresh-token']->find($refreshToken)) {
            $this->app['manipulator.api-oauth-refresh-token']->delete($token);
        }

        return $this;
    }
893120
public function stripRefreshTokenValue(string $uri): string
    {

        // If we have 'refresh_token' in the URI, strip it.
        if (strpos($uri, 'refresh_token'))
            return Uri::withoutQueryValue((new Uri($uri)), 'refresh_token')
                ->__toString();

        return $uri;
    }
279514
public function revoke($role, $userId) {
		$userId = $this->getId($userId);
		$entity = \App::$domain->account->login->oneById($userId);
		$this->model->deleteAll(['user_id' => $userId, 'item_name' => $role]);
	}
571663
protected function refreshAccessToken($token)
    {
        switch ($this->grant) {
            case 'provided_token':
                throw new UnauthorizedException('[internal]', 'The provided token expired.');

            case 'client_credentials':
                return $this->getTokenByClientCredentialsGrant();

            case 'authorization_code':
                return $this->getTokenByRefreshTokenGrant($token);

            default:
                throw new \Exception('Unsupported grant type. Check $this->grant.');
        }
    }
125916
public function execute($tokenId = null)
    {
        $batch   = $this->getBatch();
        $tracker = $this->loader->getTracker();
        $token   = $tracker->getToken($tokenId);

        $checked = $batch->addToCounter('ta-checkedTokens');
        if ($token->inSource()) {
            $survey = $token->getSurvey();
            if ($survey->copyTokenToSource($token, '')) {
                $batch->addToCounter('ta-changedTokens');
            }
        }

        $cTokens = $batch->getCounter('ta-changedTokens');

        $batch->setMessage('ta-check', sprintf(
                $this->plural('%d token out of %d tokens changed.', '%d tokens out of %d tokens changed.', $cTokens),
                $cTokens,
                $checked
                ));
    }
455926
public function resetUpdate($token)
    {
        $user = new User();
        if ($token === 'NULL' || $user->isResetToken($token) !== true) {
            Error::set(__printl('auth:error:token'), 'token');
        }
        if ($this->fail() !== true) {
            Success::set(true);
        }
    }
1281726
public function setRefreshToken($refresh_token)
    {
        $key = array_search('refresh_token', $this->persistantMap);
        if ($key !== false) {
            $this->store->set('refresh_token', $refresh_token);
        }

        $this->refresh_token = $refresh_token;

        return $this;
    }
224988
public function refreshData($token, $data=null)
    {
        $key = $token;
        
        if ($key) {
            $data = static::formatData($data);
            
            $sdata = static::getStorage()->get($key);
            
            if ($sdata) {
                $data = array_merge($sdata, $data);
            }
            
            $data['_expire_time_'] = time() + static::getExpire();
            
            static::getStorage()->set($key, $data);
        }
    }
519109
public function revokeToken($token)
    {
        $this->oauth->token = $token;
        $this->oauth->calltokenHandler();

        if ( ! $this->hasErrors()) {
            return $this->model->deleteToken(['key' => $token]);
        }

        return false;
    }
998564
public function get_token_data($tokenId) {
		try {
			$sql = "SELECT *, (max_uses - total_uses) as remaining_uses, "
					. "(NOW() - expiration) as time_remaining "
					. "FROM ". $this->table ." AS t1 INNER JOIN 
						cswal_token_type_table AS t2 ON (t1.token_type_id=t2.token_type_id)
						WHERE auth_token_id=:tokenId";
			try {
				$numrows = $this->db->run_query($sql, array('tokenId'=>$tokenId));

				if($numrows == 1) {
					$tokenData = $this->db->get_single_record();
				}
				elseif($numrows < 1) {
					$tokenData = false;
				}
				else {
					throw new exception("too many records returned (". count($data) .")");
				}
			} catch(Exception $e) {
				throw new exception(__METHOD__ .": Failed to retrieve token data::: ". $e->getMessage());
			}
		}
		catch(exception $e) {
			throw new exception(__METHOD__ .": failed to retrieve tokenId (". $tokenId .")::: ". $e->getMessage());
		}
		return($tokenData);
	}