POST /oauth/consent
Decisão do usuário (aprovar/negar)
- 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.
Exige sessão plena e Origin confiável (CSRF). Aprovar grava o consentimento, cria o grant e o código (60 s, uso único) e devolve o redirect_to (a redirect_uri com code/state/iss). Negar devolve redirect_to com error=access_denied.
Parameters
No parameters.
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
client_id | string | yes | |
redirect_uri | string | yes | |
scope | string | yes | |
state | string | yes | |
nonce | string | no | |
code_challenge | string | yes | |
code_challenge_method | string | yes | enum: |
approve | boolean | yes |
{
"client_id": "string",
"redirect_uri": "string",
"scope": "string",
"state": "string",
"nonce": "string",
"code_challenge": "string",
"code_challenge_method": "S256",
"approve": true
}Responses
200
Destino da navegação.
| Name | Type | Required | Description |
|---|---|---|---|
redirect_to | string<uri> | 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
Sem sessão válida.
| 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 |
403
Sessão restrita (menos de 2 fatores fortes). Cadastre fatores primeiro.
| 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
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
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/consent' \
-H "Cookie: access_token=$AXUZ_SESSION_JWT" \
-H "Content-Type: application/json" \
-d '{"client_id":"string","redirect_uri":"string","scope":"string","state":"string","nonce":"string","code_challenge":"string","code_challenge_method":"S256","approve":true}'Node.js
const res = await fetch("https://auth-api.axuz.net/oauth/consent", {
method: 'POST',
headers: {
Cookie: `access_token=${process.env.AXUZ_SESSION_JWT}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"client_id": "string",
"redirect_uri": "string",
"scope": "string",
"state": "string",
"nonce": "string",
"code_challenge": "string",
"code_challenge_method": "S256",
"approve": true
}),
});
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/consent",
headers={
"Cookie": f"access_token={os.environ['AXUZ_SESSION_JWT']}",
},
json={
"client_id": "string",
"redirect_uri": "string",
"scope": "string",
"state": "string",
"nonce": "string",
"code_challenge": "string",
"code_challenge_method": "S256",
"approve": True,
},
timeout=30,
)
res.raise_for_status()
print(res.json())