POST /oauth/clients/{client_id}/rotate-secret
Gera novo secret (o antigo morre na hora; mostrado 1x)
- Acesso: Pública
- Serviço:
https://auth-api.axuz.net
Autenticação aceita
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).
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
client_id | path | string | sim |
Corpo da requisição
Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.
application/json
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
(corpo) | object | não |
{}Respostas
200
Novo secret.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
client_secret | string | sim |
400
Client public não tem secret.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | 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_description | string | não |
401
Sem sessão válida.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | 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_description | string | não |
404
Inexistente ou de outro dono.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | 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_description | string | não |
429
Limite de requisições excedido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
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())