POST /oauth/token
Troca de código / rotação de refresh token
- Access: Public (link or signature)
- Service:
https://auth-api.axuz.net
Accepted authentication
clientBasicclientPost— Na prática vai no CORPO form (client_id + client_secret).
Autenticação do client: client_secret_basic (header) ou client_secret_post (corpo) para confidential; none para public (o PKCE é a prova). Rate limit por IP e por client; falhas contam.
Parameters
No parameters.
Responses
200
Tokens emitidos.
| Name | Type | Required | Description |
|---|---|---|---|
access_token | string | yes | |
token_type | string | yes | enum: |
expires_in | integer | yes | |
refresh_token | string | no | Só com offline_access. |
id_token | string | no | Só com openid. Claims de autenticação: auth_time (login original), acr (urn:axuz:acr:mfa) e amr ([mfa]). |
scope | string | yes |
400
Erro do protocolo (RFC 6749 §5.2).
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | 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 | no |
401
invalid_client.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | 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 | no |
429
Rate limit. Retry-After em segundos.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | 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 | no |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
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/token' \
-H "Cookie: access_token=$AXUZ_SESSION_JWT"Node.js
const res = await fetch("https://auth-api.axuz.net/oauth/token", {
method: 'POST',
headers: {
Cookie: `access_token=${process.env.AXUZ_SESSION_JWT}`,
},
});
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/token",
headers={
"Cookie": f"access_token={os.environ['AXUZ_SESSION_JWT']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())