doc-locale/fr-fr/api/applications.md
{{< details >}}
{{< /details >}}
Utilisez cette API pour gérer les applications OAuth à l'échelle de l'instance qui :
[!note] Vous ne pouvez pas utiliser cette API pour gérer les applications de groupe ou les applications utilisateur individuelles.
Prérequis :
Crée une application.
Renvoie 200 si la requête aboutit.
POST /applications
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
name | string | oui | Nom de l'application. |
redirect_uri | string | oui | URI de redirection de l'application. |
scopes | string | oui | Portées disponibles pour l'application. Séparez plusieurs portées par un espace. |
confidential | boolean | non | Si true, l'application peut stocker de manière sécurisée les informations d'identification du client, telles que le secret client. Les applications non confidentielles (telles que les applications mobiles natives et les applications à page unique) peuvent exposer les informations d'identification du client. Par défaut, la valeur est true si non spécifiée. |
Exemple de requête :
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--data "name=MyApplication&redirect_uri=http://redirect.uri&scopes=api read_user email" \
--url "https://gitlab.example.com/api/v4/applications"
Exemple de réponse :
{
"id":1,
"application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
"application_name": "MyApplication",
"secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",
"callback_url": "http://redirect.uri",
"confidential": true,
"scopes": ["api", "read_user", "email"]
}
Liste toutes les applications.
GET /applications
Exemple de requête :
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/applications"
Exemple de réponse :
[
{
"id":1,
"application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
"application_name": "MyApplication",
"callback_url": "http://redirect.uri",
"confidential": true,
"scopes": ["api", "read_user"]
}
]
[!note] La valeur
secretn'est pas exposée par cette API.
Supprime une application spécifiée.
Renvoie 204 si la requête aboutit.
DELETE /applications/:id
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | integer | oui | L'ID de l'application (pas le application_id). |
Exemple de requête :
curl --request DELETE \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/applications/:id"
{{< history >}}
{{< /history >}}
Renouvelle le secret d'une application spécifiée. Renvoie 200 si la requête aboutit.
POST /applications/:id/renew-secret
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | integer | oui | L'ID de l'application (pas le application_id). |
Exemple de requête :
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/applications/:id/renew-secret"
Exemple de réponse :
{
"id":1,
"application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
"application_name": "MyApplication",
"secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",
"callback_url": "http://redirect.uri",
"confidential": true,
"scopes": ["api", "read_user"]
}