Add a Token to the Blacklist. A token with scope blacklist:tokens is needed.
See https://auth0.com/docs/api/management/v2#!/Blacklists/post_tokens.

@param token the token to blacklist.
@return a Request to execute.
185866
public Request blacklistToken(Token token) {
        Asserts.assertNotNull(token, "token");

        String url = baseUrl
                .newBuilder()
                .addPathSegments("api/v2/blacklists/tokens")
                .build()
                .toString();
        VoidRequest request = new VoidRequest(client, url, "POST");
        request.addHeader("Authorization", "Bearer " + apiToken);
        request.setBody(token);
        return request;
    }
837772
public function check($token)
    {
        $blacklistedToken = $this->model
            ->where('user_id', $this->Token->getSubject($token))
            ->where('expiry', '>', Carbon::now())
            ->whereToken($token)
            ->first();

        if ($blacklistedToken === null) {
            return true;
        }

        throw new BlacklistedTokenException();
    }
230448
public Map<String, Object> validateTokenAndGetClaims(final String token) {
        final CommonProfile profile = validateToken(token);

        final Map<String, Object> claims = new HashMap<>(profile.getAttributes());
        claims.put(JwtClaims.SUBJECT, profile.getId());

        return claims;
    }
445046
public Token add( Variable variable ) {
        Token t = new Token(variable);
        push( t );
        return t;
    }
1259428
public Maybe<AccessToken> isValidToken(String token) {
        return db.findAccessToken(token)
                .flatMap(accessToken -> {
                    LOG.info("token详情:" + accessToken);
                    if (accessToken != null && accessToken.isValid()) {
                        if (accessToken.tokenExpired()) {
                            LOG.info(new JSONObject()
                                    //todo 设计一个打印type日志的Java类，将结构固定下来
                                    .fluentPut("description", "accessToken has expired, client_id= " + accessToken.getClientId())
                                    .fluentPut("accessToken", accessToken)
                                    .fluentPut("type", LogTypeOAuth20.oAuth20TokenExpired));
                            db.updateAccessTokenValidStatus(accessToken.getToken(), false).subscribe();
                            // return empty result if token expired.
                            return Maybe.empty();
                        }
                        return Maybe.just(accessToken);
                    }
                    return Maybe.empty();
                });
    }
62683
public boolean validToken(String token, String openid) {
        BeanUtil.requireNonNull(token, "token is null");
        BeanUtil.requireNonNull(openid, "openid is null");
        String url = BASE_API_URL + "sns/auth?access_token=" + token + "&openid=" + openid;
        BaseResponse r = executeGet(url);
        return isSuccess(r.getErrcode());
    }
419210
public Token add( String word ) {
        Token t = new Token(word);
        push( t );
        return t;
    }
335161
def _add_bearer_token(self, uri, http_method='GET', body=None,
                          headers=None, token_placement=None):
        """"""
        if token_placement == AUTH_HEADER:
            headers = tokens.prepare_bearer_headers(self.access_token, headers)

        elif token_placement == URI_QUERY:
            uri = tokens.prepare_bearer_uri(self.access_token, uri)

        elif token_placement == BODY:
            body = tokens.prepare_bearer_body(self.access_token, body)

        else:
            raise ValueError("Invalid token placement.")
        return uri, headers, body
1139977
public static Token retrieve(String token) throws StripeException {
    return retrieve(token, (Map<String, Object>) null, (RequestOptions) null);
  }
188721
public TokenRequest setTokenServerUrl(GenericUrl tokenServerUrl) {
    this.tokenServerUrl = tokenServerUrl;
    Preconditions.checkArgument(tokenServerUrl.getFragment() == null);
    return this;
  }
1021861
public User existsByInviteToken(String token) {
		Criteria criteria = this.dao.newCriteria(User.class).add(Restrictions.eq("inviteToken", token));
		return (User) criteria.uniqueResult();
	}
669404
public function addToken(Token $token)
    {
        $response = $this
            ->httpClient
            ->get(
                sprintf('/%s/tokens', $this->getAppUUID()->getId()),
                'put',
                [],
                $token->toArray(),
                Http::getApisearchHeaders($this)
            );

        self::throwTransportableExceptionIfNeeded($response);
    }
259032
public synchronized void initialiseFromAPIToken(final String token)
	{
		final String responseStr = authService.getToken(UserManagerOAuthService.GRANT_TYPE_TOKEN_EXCHANGE,
		                                                null,
		                                                getOwnCallbackUri().toString(),
		                                                clientId,
		                                                clientSecret,
		                                                null,
		                                                null,
		                                                null,
		                                                token);

		loadAuthResponse(responseStr);
	}
455083
public PlatformResponse revokeToken(String token) throws ConnectionException {

        logger.debug("Enter OAuth2PlatformClient::revokeToken");
        
        PlatformResponse platformResponse = new PlatformResponse();
        try {
            
            HttpRequestClient client = new HttpRequestClient(oauth2Config.getProxyConfig());
            Request request = new Request.RequestBuilder(MethodType.POST, oauth2Config.getIntuitRevokeTokenEndpoint())
                                        .requiresAuthentication(true)
                                        .authString(getAuthHeader())
                                        .postParams(getUrlParameters("revoke", token, null))
                                        .build();

            Response response = client.makeRequest(request);
            
            logger.debug("Response Code : "+ response.getStatusCode());
            if (response.getStatusCode() != 200) {
                logger.debug("failed to revoke token");
                platformResponse.setStatus("ERROR");
                platformResponse.setErrorCode(response.getStatusCode() + "");
                platformResponse.setErrorMessage("Failed to revoke token");
                return platformResponse;
            }
            
            platformResponse.setStatus("SUCCESS");
            return platformResponse;
        }
        catch (Exception ex) {
            logger.error("Exception while calling revokeToken ", ex);
            throw new ConnectionException(ex.getMessage(), ex);
        }    
    }
1092307
def blacklist_token():
    
    req = flask.request.get_json(force=True)
    data = guard.extract_jwt_token(req['token'])
    blacklist.add(data['jti'])
    return flask.jsonify(message='token blacklisted ({})'.format(req['token']))
1147589
public StandardSession getSessionByToken(String token) {
		StandardSession session;
		synchronized (sessions) {
			session = (StandardSession) sessions.get(token);
			if (session != null) {
				session.updateLastAccessedTime();
			}
		}
		return session;
	}
1047518
@NotNull
    @ObjectiveCName("joinGroupViaLinkCommandWithToken:")
    public Command<Integer> joinGroupViaToken(String token) {
        return callback -> modules.getGroupsModule().joinGroupByToken(token)
                .then(v -> callback.onResult(v))
                .failure(e -> callback.onError(e));
    }