Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
Click here >
Docs Menu
Docs Home
/ /

Revocar token de la cuenta de servicio

POST https://cloud.mongodb.com/api/oauth/revoke

Este endpoint no utiliza parámetros de ruta de solicitud HTTP.

Los siguientes parámetros de query son opcionales:

Nombre
Tipo
Necesidad
Descripción
predeterminado

bonito

booleano

Opcional

false

envelope

booleano

Opcional

Bandera que indica si se debe o no envolver la respuesta en un sobre.

Algunos Los clientes API no pueden acceder a los encabezados de respuesta HTTP ni al código de estado. Para remediarlo, establezca envelope : true en la query.

Para los endpoints que devuelven una lista de resultados, el objeto content es un sobre. Cloud Manager añade el campo status al cuerpo de la respuesta.

false

backupJobsEnabledOnly

booleano

Opcional

Indicador que indica si se deben excluir los demonios que no están habilitados para hacer copias de seguridad de bases de datos de la respuesta. Establece esto en false para incluir las configuraciones del demonio con la bandera backupJobsEnabled establecida en false.

true

Todos los parámetros del cuerpo son obligatorios.

Nombre
Tipo
Descripción

TOKEN

string

El token de acceso que deseas revocar. Para aprender más, consulta Generar token de cuenta de servicio.

Reemplaza {BASE64-AUTH} en el siguiente ejemplo con tu ID de cliente de la cuenta de servicio codificado en base64y el secreto. Para obtener más información, consulte Realizar una API solicitud.

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/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
HTTP/1.1 400 Bad Request
Date: {dateInUnixFormat}
Content-Type: application/json
Content-Length: {requestLengthInBytes}
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 403 Forbidden
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 429 Too Many Requests
Retry-After: {retryAfterValue}
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 500 Internal Server Error
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 503 Service Unavailable
Retry-After: {retryAfterValue}
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...

Este endpoint no devuelve un cuerpo de respuesta.

{
"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"
}

Volver

Generar token

En esta página