# OAuth2 - Password

A aplicação cliente da solução deve solicitar ao usuário as credenciais de acesso antes de fazer a requisição.&#x20;

<mark style="color:green;">`POST`</mark> <https://cess.lab.vaultid.com.br/oauth>

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |
| Accept       | string | application/json |

#### Request Body

| Name           | Type    | Description                                                                                                                                                       |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| client\_id     | string  | Identificação da aplicação.                                                                                                                                       |
| client\_secret | string  | Senha da aplicação.                                                                                                                                               |
| username       | string  | Identificação do usuário por meio do CPF/CNPJ. Pode ser do tipo string, preencha com zeros à esquerda (11 dígitos para CPF e 14 para CNPJ).                       |
| password       | string  | Número OTP.                                                                                                                                                       |
| grant\_type    | string  | Fixo "password".                                                                                                                                                  |
| scope          | string  | Se não informado será considerado "authentication\_session".                                                                                                      |
| lifetime       | integer | Indica o tempo de vida desejado para o token a ser gerado em segundos. Possuindo tempo tempo máximo de 7 dias para pessoa física, e 30 dias para pessoa jurídica. |
| provider       | string  | Identificador da nuvem à qual o usuário pertence.                                                                                                                 |

{% tabs %}
{% tab title="200 " %}

```
{
    "access_token": "41442a8c2bb0609d248cc467342c4f1b0a51c92c",
    "expires_in": 604800,
    "token_type": "bearer",
    "scope": "signature_session service_2fa",
    "provider": "SOLUTIHOM",
    "Authorization": "VCSchema U09MVVRJSE9NLXw0MTQ0MmE4YzJiYjA2MDlkMjQ4Y2M0NjczNDJjNGYxYjBhNTFjOTJj"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vaultid.com.br/workspace/cess/api/autenticacao-e-autorizacao-1/oauth2-password.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
