> For the complete documentation index, see [llms.txt](https://help.glpi-project.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.glpi-project.org/tutorials/fr/notifications/oauth_smtp_google.md).

# Oauth SMTP Google

{% hint style="warning" %}
Google n'admet que des URLs pbuliques ET sécurisées (https). Si l'URL de votre GLPI n'est pas disponible depuis Internet, cette procédure ne sera pas applicable.
{% endhint %}

## Création d'un projet

* Depuis votre [console Google](https://console.cloud.google.com/) (accès administrateur requis), rendez-vous dans votre **`organisation`** puis **`nouveau projet`**

![Création du projet](/files/OIsXSnsKW0TdEr92CmvN)

* Saisissez le nom de votre projet
* Cliquez sur **`créer`**

  <div align="left"><img src="/files/kZNlcYr4z8gPEuUi7ucR" alt="Paramétrer les informations du projet"></div>
* Revenez à votre organisation,
* Sélectionnez votre projet

  ![Sélection du projet nouvellement créé](/files/2xkBJFJcEB886heSZJRI)

## Configuration de l'accès Oauth

* Dans le menu, cliquez sur **`APIs & Services`**.
* Puis **`Écran de consentement OAuth`**.

  <div align="left"><img src="/files/qccV7U80HGAMQrjvSWGW" alt="Sélection des consentements OAuth"></div>

### Apercu

* Dans l'onglet **Overview**, cliquez sur **Pour commencer**
* Entrez les informations de l'application&#x20;

<figure><img src="/files/hljAxzpFHrAmm1FHgKxv" alt=""><figcaption><p>Information de l'application</p></figcaption></figure>

### Audience&#x20;

* L'onglet suivant vous amène sur l'**Audiance** et vous permet d'indiquer à qui cette application est destinée :&#x20;
  * **Interne** : uniquement aux utilisateurs de l'organisation
  * **Externe** : toute personne disposant d'un compte Google

<figure><img src="/files/VHCy9bAm0vltZ6YHBKYU" alt=""><figcaption><p>Sélection de l'audience concernée</p></figcaption></figure>

### Information du contact

Tout changement sur l'application créée sera envoyé au contact identifié dans cette partie

<figure><img src="/files/s3bwMXrVIwSDbWOz28V1" alt=""><figcaption><p>Indication du contact en cas de modification d'application</p></figcaption></figure>

### Politique de confidentialité des services API Google

Validez la politique de confidentialité et cliquez sur **Continuer**

<figure><img src="/files/ch1J4G2BLe1MWqh31PUO" alt=""><figcaption><p>Validation de la politique de confidentialité</p></figcaption></figure>

## Clients

La création du client va permettre d'indiquez la ou les URL de redirection (identifiée comme **`callback`** dans GLPI) ainsi que le secret client.

### Information

Indiquez le type d'application **`Application Web`** ainsi que le nom du client

<figure><img src="/files/vXgwoZYXn1fV9cRvp6XP" alt=""><figcaption><p>Ajout d'une application web</p></figcaption></figure>

### URI de redirection autorisés

L'URL de retour devra être indiquée dans cette partie. Cette URL est indiquée dans GLPI dans la section **`Configuration`** > **`Notifications`** > **`Configuration des notifications par email`**

<figure><img src="/files/XcK5j6xvPxmql3JkUzHY" alt=""><figcaption></figcaption></figure>

<div align="left"><figure><img src="/files/eO1UuFmTkj84lGyO7uHa" alt=""><figcaption><p>URI de redirection authorisée</p></figcaption></figure></div>

### Secret Client

{% hint style="warning" %}
A la prochaine étape, le secret client vous sera affiché. Dès que vous quitterez cet écran, il ne sera plus disponible. Pensez à le sauvegarder en lieu sûr
{% endhint %}

Les informations du prochain écran seront à indiquer dans GLPI **`Configuration`** > **`Notifications`** > **`Configuration des notifications par email`**

<div align="left"><figure><img src="/files/HAlVpJu4Sq2EZzyzXp6D" alt=""><figcaption><p>Visualisation du secret client</p></figcaption></figure></div>

* Sélectionnez Google dans la partie **Fournisseur OAuth**
* Indiquez le **Client ID** ainsi que le **Secret Client**

<figure><img src="/files/ex0sLxQ97Q5Sate2HLS9" alt=""><figcaption><p>Répercussion des informations de l'application Google dans GLPI</p></figcaption></figure>

## Finalisation de la configuration dans GLPI

* Renseignez les informations ci-dessous dans GLPI afin de finaliser la configuration :&#x20;

| Champs                 | Valeurs                                                                                                                                                                     |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`Hôte SMTP`**        | *smtp.gmail.com*                                                                                                                                                            |
| **`Port`**             | *587*                                                                                                                                                                       |
| **`Expéditeur email`** | Si vide, la valeur sera **`adresse email expéditeur`**. Si la valeur est différente de l'email expéditeur, la configuration échouera, les 2 valeurs doivent être identiques |

<div align="left"><img src="/files/u98e1ddcxvNvlJ9rXnRc" alt="Finalisation de la configuration de GLPI"></div>

* Cliquez sur **`enregistrer`**

Un compte Gmail vous sera demandé, puis il faudra accepter les autorisations nécessaires.

{% hint style="warning" %}
**Point d'attention**

Le compte synchronisé avec Oauth SMTP doit également être celui qui envoie les emails. Ce compte est identifié dans l'email de l'expéditeur

<img src="/files/BjRG4ed6r2YpVHW3E8NN" alt="" data-size="original">
{% endhint %}

<div align="left"><img src="/files/CVDk2mAwkkOy7wwkeBvj" alt="Test d&#x27;envoi"></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.glpi-project.org/tutorials/fr/notifications/oauth_smtp_google.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
