# Authentification

## Génération d'un token d'authentification

<mark style="color:green;">`POST`</mark> `auth/generateAuthToken`

Récupération d'un token, utilisé, par exemple, pour la consommation de web service ou l'utilisation via une iframe afin de passer l'écran de connexion.

#### Headers

| Name                                            | Type             | Description |
| ----------------------------------------------- | ---------------- | ----------- |
| Authorization<mark style="color:red;">\*</mark> | Basic            |             |
| Content-Type<mark style="color:red;">\*</mark>  | application/json |             |

#### Request Body

| Name                                         | Type    | Description                                                                                                                |
| -------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| username<mark style="color:red;">\*</mark>   | string  | Identifiant de l'utilisateur associé au token (e.g : admin)                                                                |
| expiration<mark style="color:red;">\*</mark> | integer | Nombre de jours avant expiration du token                                                                                  |
| token                                        | String  | Si mentionné, vérification de la validité du token. Si ce dernier est expiré, le webservice vous retourne un nouveau token |

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

{% endtab %}
{% endtabs %}

<details>

<summary>Retour du web service</summary>

```json
[
    "token": "XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXX.XXXXXXXXXXXXX-XXXXXXXXXXXXX"
}

```

</details>
