blob: 4f8234a6f7a0bfd126ce750933ae80e329872b35 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
---
title: WWW-Authenticate
slug: Web/HTTP/Headers/WWW-Authenticate
translation_of: Web/HTTP/Headers/WWW-Authenticate
---
<p>{{HTTPSidebar}}<br>
L'entête HTTP de réponse <strong><code>WWW-Authenticate</code></strong> définit la méthode d'authentification qui doit être utilisé pour obtenir l'accès à une ressource.</p>
<p>L'entête <code>WWW-Authenticate</code> est envoyée en même temps qu'une réponse {{HTTPStatus("401")}} <code>Unauthorized</code>.</p>
<table class="properties">
<tbody>
<tr>
<th scope="row">Type de l'entête</th>
<td>{{Glossary("Response header")}}</td>
</tr>
<tr>
<th scope="row">{{Glossary("Forbidden header name")}}</th>
<td>non</td>
</tr>
</tbody>
</table>
<h2 id="Syntaxe">Syntaxe</h2>
<pre class="syntaxbox">WWW-Authenticate: <type> realm=<realm>
</pre>
<h2 id="Directives">Directives</h2>
<dl>
<dt><type></dt>
<dd><a href="/en-US/docs/Web/HTTP/Authentication#Authentication_schemes">Type d'authentification</a>. Un type commun est <a href="/en-US/docs/Web/HTTP/Authentication#Basic_authentication_scheme">"Basic"</a>. IANA maintient une <a href="http://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml">liste des schémas d'authentification</a>.</dd>
<dt>realm=<realm></dt>
<dd>Une description de la zone protégée. Si aucun domaine n'est spécifié, les clients affichent souvent un nom de domaine formaté à la place.</dd>
<dt>charset=<charset></dt>
<dd>Indique au client le schéma d'encodage préféré du serveur lorsqu'on soumet un nom d'utilisateur et un mot de passe. La seule valeur acceptée est la chaine insensible à la casse "UTF-8". Cela ne s'applique pas à l'encodage de la chaine du domaine.</dd>
</dl>
<h2 id="Exemples">Exemples</h2>
<p>La réponse d'un serveur contient généralement l'entête <code>WWW-Authenticate</code> qui ressemble à ça :</p>
<pre>WWW-Authenticate: Basic
WWW-Authenticate: Basic realm="Accès au site de staging", charset="UTF-8"
</pre>
<p>Voir aussi <a href="/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a> pour des exemples sur la configuration des serveurs Apache ou nginx pour protéger protéger votre site par mot de passe en utilisant l'authentification HTTP basic.</p>
<h2 id="Spécifications">Spécifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Spécification</th>
<th scope="col">Titre</th>
</tr>
<tr>
<td>{{RFC("7235", "WWW-Authenticate", "4.1")}}</td>
<td>HTTP/1.1: Authentication</td>
</tr>
<tr>
<td>{{RFC("7617")}}</td>
<td>The 'Basic' HTTP Authentication Scheme</td>
</tr>
</tbody>
</table>
<h2 id="Voir_aussi">Voir aussi</h2>
<ul>
<li><a href="/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a></li>
<li>{{HTTPHeader("Authorization")}}</li>
<li>{{HTTPHeader("Proxy-Authorization")}}</li>
<li>{{HTTPHeader("Proxy-Authenticate")}}</li>
<li>{{HTTPStatus("401")}}, {{HTTPStatus("403")}}, {{HTTPStatus("407")}}</li>
</ul>
|