Skip to main content

RFC 2617 - HTTP Authentication: Basic and Digest Access Authentication

Published: June 1999
Status: Standards Track
Authors: J. Franks, P. Hallam-Baker, J. Hostetler, S. Lawrence, P. Leach, A. Luotonen, L. Stewart
Obsoletes: RFC 2069
Obsoleted by: RFC 7235, RFC 7615, RFC 7616, RFC 7617


Abstract

"HTTP/1.0", includes the specification for a Basic Access Authentication scheme. This scheme is not considered to be a secure method of user authentication (unless used in conjunction with some external secure system such as SSL), as the user name and password are passed over the network as cleartext.

This document also provides the specification for HTTP's authentication framework, the original Basic authentication scheme and a scheme based on cryptographic hashes, referred to as "Digest Access Authentication". It is therefore also intended to serve as a replacement for RFC 2069. Some optional elements specified by RFC 2069 have been removed from this specification due to problems found since its publication; other new elements have been added for compatibility, those new elements have been made optional, but are strongly recommended.

Like Basic, Digest access authentication verifies that both parties to a communication know a shared secret (a password); unlike Basic, this verification can be done without sending the password in the clear, which is Basic's biggest weakness. As with most other authentication protocols, the greatest sources of risks are usually found not in the core protocol itself but in policies and procedures surrounding its use.


Status of this Memo

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.


Table of Contents

  • 1. Access Authentication
    • 1.1 Reliance on the HTTP/1.1 Specification
    • 1.2 Access Authentication Framework
  • 2. Basic Authentication Scheme
  • 3. Digest Access Authentication Scheme
    • 3.1 Introduction
      • 3.1.1 Purpose
      • 3.1.2 Overall Operation
      • 3.1.3 Representation of digest values
      • 3.1.4 Limitations
    • 3.2 Specification of Digest Headers
      • 3.2.1 The WWW-Authenticate Response Header
      • 3.2.2 The Authorization Request Header
      • 3.2.3 The Authentication-Info Header
    • 3.3 Digest Operation
    • 3.4 Security Protocol Negotiation
    • 3.5 Example
    • 3.6 Proxy-Authentication and Proxy-Authorization
  • 4. Security Considerations
    • 4.1 Authentication of Clients using Basic Authentication
    • 4.2 Authentication of Clients using Digest Authentication
    • 4.3 Limited Use Nonce Values
    • 4.4 Comparison of Digest with Basic Authentication
    • 4.5 Replay Attacks
    • 4.6 Weakness Created by Multiple Authentication Schemes
    • 4.7 Online dictionary attacks
    • 4.8 Man in the Middle
    • 4.9 Chosen plaintext attacks
    • 4.10 Precomputed dictionary attacks
    • 4.11 Batch brute force attacks
    • 4.12 Spoofing by Counterfeit Servers
    • 4.13 Storing passwords
    • 4.14 Summary
  • 5. Sample implementation
  • 6. Acknowledgments
  • 7. References
  • 8. Authors' Addresses

Core Concepts

Two Authentication Schemes

1. Basic Authentication

  • Principle: Username and password sent Base64-encoded
  • Format: Authorization: Basic base64(username:password)
  • Security: ⚠️ Clear text transmission, insecure (unless using HTTPS)
  • Use Cases: Simple applications, internal systems, combined with HTTPS

2. Digest Authentication

  • Principle: Uses MD5 hash, password not transmitted in clear text
  • Format: Includes nonce, realm, qop and other parameters
  • Security: ✅ More secure than Basic, but HTTPS still recommended
  • Use Cases: HTTP authentication requiring higher security

Authentication Flow

Client                                  Server
| |
|------- 1. Request protected -------->|
| resource |
| |
|<------ 2. 401 + WWW-Authenticate ----|
| (challenge) |
| |
|------- 3. Authorization header ----->|
| (credentials) |
| |
|<------ 4. 200 OK + resource ---------|
| |

HTTP Status Codes

  • 401 Unauthorized: Authentication required
  • 407 Proxy Authentication Required: Proxy authentication required

Key HTTP Headers

  • WWW-Authenticate: Challenge sent by server
  • Authorization: Credentials sent by client
  • Authentication-Info: Optional authentication information
  • Proxy-Authenticate: Challenge from proxy server
  • Proxy-Authorization: Credentials sent to proxy

Examples

Basic Authentication Example

Server Response:

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="WallyWorld"

Client Request:

GET /private/index.html HTTP/1.1
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Digest Authentication Example

Server Response:

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest
realm="[email protected]",
qop="auth,auth-int",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
opaque="5ccc069c403ebaf9f0171e9517f40e41"

Client Request:

GET /dir/index.html HTTP/1.1
Authorization: Digest username="Mufasa",
realm="[email protected]",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
uri="/dir/index.html",
qop=auth,
nc=00000001,
cnonce="0a4f113b",
response="6629fae49393a05397450978507c4ef1",
opaque="5ccc069c403ebaf9f0171e9517f40e41"

  • Official Text: RFC 2617 (TXT)
  • Official Page: RFC 2617 DataTracker
  • Obsoletes: RFC 2069
  • Obsoleted by:
    • RFC 7235 (HTTP/1.1 Authentication)
    • RFC 7615 (HTTP Authentication-Info)
    • RFC 7616 (HTTP Digest Access Authentication)
    • RFC 7617 (HTTP Basic Authentication)

Security Warning ⚠️

  1. Basic authentication is insecure: MUST be used with HTTPS
  2. Digest authentication has limitations: Though better than Basic, HTTPS still recommended
  3. Modern alternatives: Consider using OAuth 2.0, JWT or other modern authentication mechanisms
  4. Password storage: Servers should store passwords using salted hashes

Important Notice: RFC 2617 has been obsoleted by RFC 7235, 7616, 7617, and others. Modern applications should refer to these updated standards, or use modern authentication frameworks such as OAuth 2.0.