aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/http/status/401/index.md
blob: 9f2b34f9fe20c67380fb064771e48030eca128a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: 401 Unauthorized
slug: Web/HTTP/Status/401
tags:
  - Code de statut
  - Erreur client
  - HTTP
  - Reference
translation_of: Web/HTTP/Status/401
---
{{HTTPSidebar}}

Le code de statut de réponse HTTP **`401 Unauthorized`** indique que la requête n'a pas été effectuée car il manque des informations d'authentification valides pour la ressource visée.

Ce statut est envoyé avec un en-tête {{HTTPHeader("WWW-Authenticate")}} qui décrit la méthode pour s'authentifier correctement.

Ce statut est similaire à {{HTTPStatus("403")}} mais, dans ce cas, une authentification est possible.

## Statut

    401 Unauthorized

## Exemple de réponse

    HTTP/1.1 401 Unauthorized
    Date: Wed, 21 Oct 2015 07:28:00 GMT
    WWW-Authenticate: Basic realm="Access to staging site"

## Spécifications

| Spécification                                            | Titre                    |
| -------------------------------------------------------- | ------------------------ |
| {{RFC("7235", "401 Unauthorized" , "3.1")}} | HTTP/1.1: Authentication |

## Compatibilité des navigateurs

{{Compat("http/status", "401")}}

## Voir aussi

- [La gestion de l'authentification en HTTP](/fr/docs/Web/HTTP/Authentication)
- {{HTTPHeader("WWW-Authenticate")}}
- {{HTTPHeader("Authorization")}}
- {{HTTPHeader("Proxy-Authorization")}}
- {{HTTPHeader("Proxy-Authenticate")}}
- {{HTTPStatus("403")}}, {{HTTPStatus("407")}}