Axuz Developers

POST /oauth/clients/{client_id}/rotate-secret

Gera novo secret (o antigo morre na hora; mostrado 1x)

  • Access: Public
  • Service: https://auth-api.axuz.net

Accepted authentication

  • sessionCookie — Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.

Implementa POST /oauth/clients/{client_id}/rotate-secret: o secret antigo morre na hora; o novo aparece só nesta resposta. Public não tem secret (400). Onde: tela de desenvolvedor (OriginCheck).

Parameters

NameInTypeRequiredDescription
client_idpathstringyes

Request body

Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.

application/json

NameTypeRequiredDescription
(corpo)objectno
{}

Responses

200

Novo secret.

NameTypeRequiredDescription
client_secretstringyes

400

Client public não tem secret.

NameTypeRequiredDescription
errorstringyes

invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, invalid_token, insufficient_scope, access_denied, login_required, consent_required, enrollment_required, rate_limited, not_found, server_error.

error_descriptionstringno

401

Sem sessão válida.

NameTypeRequiredDescription
errorstringyes

invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, invalid_token, insufficient_scope, access_denied, login_required, consent_required, enrollment_required, rate_limited, not_found, server_error.

error_descriptionstringno

404

Inexistente ou de outro dono.

NameTypeRequiredDescription
errorstringyes

invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, invalid_token, insufficient_scope, access_denied, login_required, consent_required, enrollment_required, rate_limited, not_found, server_error.

error_descriptionstringno

429

Limite de requisições excedido.

NameTypeRequiredDescription
errorstringyes

500

Erro interno. Tente de novo com backoff; reporte o X-Request-Id.

NameTypeRequiredDescription
errorstringyes

Examples

"Try it" is turned off in this reference. Use the examples with your test credential.

curl

curl -sS -X POST 'https://auth-api.axuz.net/oauth/clients/CLIENT_ID/rotate-secret' \
  -H "Cookie: access_token=$AXUZ_SESSION_JWT" \
  -H "Content-Type: application/json" \
  -d '{}'

Node.js

const res = await fetch("https://auth-api.axuz.net/oauth/clients/CLIENT_ID/rotate-secret", {
  method: 'POST',
  headers: {
    Cookie: `access_token=${process.env.AXUZ_SESSION_JWT}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());

Python

import os
import requests

res = requests.request(
    "POST",
    "https://auth-api.axuz.net/oauth/clients/CLIENT_ID/rotate-secret",
    headers={
        "Cookie": f"access_token={os.environ['AXUZ_SESSION_JWT']}",
    },
    json={},
    timeout=30,
)
res.raise_for_status()
print(res.json())