要学习;了解有关服务帐户令牌的更多信息,请参阅服务帐户概述。
Resource
POST https://cloud.mongodb.com/api/oauth/revoke请求路径参数
此端点不使用 HTTP 请求路径参数。
请求查询参数
以下查询参数为可选参数:
名称 | 类型 | 必要性 | 说明 | 默认 |
|---|---|---|---|---|
pretty | 布尔 | Optional |
| |
envelope | 布尔 | Optional | 指示是否将响应包装在信封中的标志。 某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,在查询中设置 对于返回结果列表的端点, |
|
请求正文参数
需要所有正文参数。
名称 | 类型 | 说明 |
|---|---|---|
| 字符串 | 要撤销的访问权限令牌。 要学习;了解详情,请参阅生成服务帐户令牌。 |
响应
请求示例
将以下示例中的 {BASE64-AUTH} 替换为经过基本 64 编码的服务账户客户端ID和密钥。要了解更多,请参阅 发出 API 请求。
curl -X POST https://cloud.mongodb.com/api/oauth/revoke \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Authorization: Basic {BASE64-AUTH}" \ -d "token={TOKEN}&token_type_hint=access_token"响应示例
响应标头
HTTP/2 200 OKdate: {dateInUnixFormat}strict-transport-security: max-age=31536000; includeSubdomains;vary: Accept-Encodingcontent-type: application/vnd.atlas.{apiVersion}+json;charset=utf-8referrer-policy: strict-origin-when-cross-originx-permitted-cross-domain-policies: nonex-content-type-options: nosniffx-mongodb-service-version: gitHash={gitHash}; versionString={applicationVersion}x-frame-options: DENYcontent-length: {requestLengthInBytes}x-envoy-upstream-service-time: 44server: mdbwsHTTP/1.1 400 Bad RequestDate: {dateInUnixFormat}Content-Type: application/jsonContent-Length: {requestLengthInBytes}Server: mdbwsStrict-Transport-Security: max-age=31536000; includeSubdomains;X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}...HTTP/1.1 401 UnauthorizedContent-Type: application/json;charset=ISO-8859-1Date: {dateInUnixFormat}WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=falseContent-Length: {requestLengthInBytes}Connection: keep-aliveHTTP/1.1 403 ForbiddenVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}...HTTP/1.1 429 Too Many RequestsRetry-After: {retryAfterValue}Vary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}...HTTP/1.1 500 Internal Server ErrorVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Content-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}...HTTP/1.1 503 Service UnavailableRetry-After: {retryAfterValue}Vary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Content-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}...响应体
此端点不返回响应正文。
{ "error_description": "The provided credentials are not valid.", "error": "invalid_request"}{ "error_description": "Invalid grant type.", "error": "unsupported_grant_type"}{ "error_description": "Invalid grant.", "error": "invalid_grant"}{ "error_description": "Invalid credentials provided.", "error": "invalid_client"}{ "error_description": "IP access list validation failed for the service account.", "error": "access_denied"}{ "error_description": "Resource {URL} is limited to 10 requests every 1 minutes.", "error": "rate_limited"}{ "error_description": "Unexpected error.", "error": "server_error"}