WWW-Authenticate

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

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.

Ejemplos

Típicamente, la respuesta del servidor contiene una cabecera WWW-Authenticate que se parece a estas:

WWW-Authenticate: Basic

WWW-Authenticate: Basic realm="Access to the staging site", charset="UTF-8"

Vea también HTTP authentication por ejemplos sobre como configurar un servidor Apache o nginx para proteger con contraseña tu sitio con autenticación básica HTTP.

Especificaciones

Specification
HTTP Semantics
# field.www-authenticate

Compatibilidad con navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
WWW-Authenticate
Basic authentication
Digest authentication
SHA2-256 digest authentication
MD5 digest authentication
NTLM authentication
Negotiate (Kerberos) authentication

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Véase también