Entrar

Autenticar

POST https://{organization}.myguper.com/api/connect/auth

Autentica um usuário por login + password e devolve a identidade correspondente (personId, type).

Opcionalmente aceita um challenge e nonce de Proof of Work obtidos do endpoint Gerar desafio. Quando fornecidos, o servidor valida que SHA-256(challenge + nonce) <= target antes de verificar as credenciais. Isso previne ataques de força bruta exigindo trabalho computacional antes de cada tentativa de login.

Importante: Os campos challenge e nonce são atualmente opcionais por compatibilidade. Eles se tornarão obrigatórios em uma versão futura. Todos os clientes devem integrar o fluxo de Proof of Work o mais breve possível.

Credencial errada responde sempre o mesmo 401 — a resposta nunca diz se o login existe. Depois de 8 tentativas falhas para o mesmo login, o endpoint responde 429 e para de conferir a senha por 15 minutos; um login bem-sucedido zera o contador.

Try-it values populated from environment ACME (Demo)


Autenticação

Token

Most Connect endpoints require a valid x-guper-authorization token. Token issuance itself (/api/connect/auth) is the exception — it uses the x-guper-apikey and x-guper-apisecret credentials.

Cabeçalhos

Name Type Description
x-guper-authorization * string User token issued by Guper.
Content-Type * string Always `application/json` for endpoints that accept a JSON body.

Corpo da requisição

Content-Type: json

{
    "login": "tintin",
    "password": "a10b20c30",
    "challenge": "a1b2c3d4...64 hex chars",
    "nonce": "48293"
}

Respostas

{
    "personId": 44,
    "type": "user",
    "dateTime": "2023-08-24T17:13:52-03:00"
}
Copied to clipboard