WWW-Authenticate
La cabezera de la respuesta HTTP WWW-Authenticate
define el método de autentificación que debe ser utilizado para acceder al recurso solicitado.
La cabezera WWW-Authenticate
es enviada junto al estado 401
Unauthorized
en la respuesta.
Header type | Response header |
---|---|
Forbidden header name | no |
Syntax
WWW-Authenticate: <type> realm=<realm>
Directives
- <type>
- Tipo de autentificación. Un tipo común es "Basic". IANA mantiene una lista de los esquemas de autentificación.
- realm=<realm>
- Una descripción del recurso protegido. Si el realm no es especificado, los clientes a menudo muestran el hostname.
- charset=<charset>
- Le indica al cliente el tipo de encoding scheme preferido por el servidor cuando se envía un nombre de usuario y contraseña. El único valor permitido es la cadena de texto (no diferencia entre mayúsculas o mínusculas) "UTF-8". Esto no esta relacionado a el encoding del parámetro realm.
Examples
Typically, a server response contains a WWW-Authenticate
header that looks like these:
WWW-Authenticate: Basic WWW-Authenticate: Basic realm="Access to the staging site", charset="UTF-8"
See also HTTP authentication for examples on how to configure Apache or nginx servers to password protect your site with HTTP basic authentication.
Specifications
Specification | Title |
---|---|
RFC 7235, section 4.1: WWW-Authenticate | HTTP/1.1: Authentication |
RFC 7617 | The 'Basic' HTTP Authentication Scheme |
Browser compatibility
BCD tables only load in the browser