GET /oauth/consent
Pré-visualização do consentimento (JSON, para a tela do auth_client)
- 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.
Mesma query do /oauth/authorize. Revalida tudo no servidor. A tela DEVE destacar client.verified=false (app de terceiro não verificado), mostrar client.redirect_host (para onde o usuário volta) e marcar os escopos com sensitive=true. É a API que a tela /oauth/consent do axuz_auth_client usa (substitui o OAuth antigo do axuz_api).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
client_id | query | string | yes | |
redirect_uri | query | string | yes | |
scope | query | string | yes | |
state | query | string | yes | |
code_challenge | query | string | yes | |
code_challenge_method | query | string | yes | |
nonce | query | string | no |
Responses
200
App e escopos pedidos.
| Name | Type | Required | Description |
|---|---|---|---|
client | object | yes | |
client.client_id | string | yes | |
client.name | string | yes | |
client.verified | boolean | yes | false = app não verificado pelo operador: destacar na tela. |
client.redirect_host | string | yes | Host (com porta) da redirect_uri; esquema customizado para app nativo. |
scopes | array<object> | yes | |
scopes[].code | string | yes | |
scopes[].description | string | yes | |
scopes[].sensitive | boolean | yes | Exige client verificado; destacar na tela. |
already_granted | boolean | 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 GET 'https://auth-api.axuz.net/oauth/consent?client_id=VALUE&redirect_uri=VALUE&scope=VALUE&state=VALUE&code_challenge=VALUE&code_challenge_method=VALUE' \
-H "Cookie: access_token=$AXUZ_SESSION_JWT"Node.js
const res = await fetch("https://auth-api.axuz.net/oauth/consent?client_id=VALUE&redirect_uri=VALUE&scope=VALUE&state=VALUE&code_challenge=VALUE&code_challenge_method=VALUE", {
method: 'GET',
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(
"GET",
"https://auth-api.axuz.net/oauth/consent?client_id=VALUE&redirect_uri=VALUE&scope=VALUE&state=VALUE&code_challenge=VALUE&code_challenge_method=VALUE",
headers={
"Cookie": f"access_token={os.environ['AXUZ_SESSION_JWT']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())