HTTP Status 407 - Proxy Authentication Required

Der HTTP-Status-Code 407 Proxy Authentication Required signalisiert, dass Client sich am Proxy authentifizieren muss. Ähnlich zu 401, aber für Proxy-Authentication statt Origin-Server-Authentication. Response muss Proxy-Authenticate Header enthalten.

Typ

Response-Status-Code

Syntax

Der Status Code wird mit Proxy-Authenticate Header vom Proxy zurückgegeben.

http
HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic realm="Corporate Proxy"

Direktiven

Der 407 Proxy Authentication Required Status Code wird für Proxy-Authentication verwendet.

Proxy Authentication
Client muss sich am Proxy authentifizieren mit Proxy-Authorization Header. Unterscheidet sich von 401, wo Authentication am Origin Server erfolgt.
Proxy-Authenticate Header
Response muss Proxy-Authenticate Header mit Challenge enthalten (Basic, Digest, NTLM). Spezifiziert Authentication-Schema für Proxy.
Corporate Proxies
Häufig in Unternehmens-Netzwerken, wo alle Requests durch authenticating Forward Proxy laufen. Client muss Proxy-Credentials vor Origin-Server-Access liefern.

Beispiele

Nachfolgend finden Sie praktische Anwendungsbeispiele für Status 407.

Beispiel 1 Corporate Proxy Authentication

http
GET https://api.example.com/data HTTP/1.1
Host: api.example.com

HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic realm="Corporate Proxy"
Proxy-Connection: keep-alive

<html><body>Proxy authentication required</body></html>

Beispiel 2 After Proxy Authentication Success

http
GET https://api.example.com/data HTTP/1.1
Host: api.example.com
Proxy-Authorization: Basic dXNlcjpwYXNz

HTTP/1.1 200 OK
Via: 1.1 corporate-proxy.example.com
Content-Type: application/json

{"data": "..."}

Beispiel 3 NTLM Proxy Challenge

http
GET https://intranet.example.com/app HTTP/1.1
Host: intranet.example.com

HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: NTLM
Proxy-Connection: close

Proxy Authentication Flow

407 Proxy Authentication Required für Corporate Forward Proxy

Vorteile für die Systemarchitektur

  • Corporate Network Control: Ermöglicht Unternehmens-Kontrolle über Internet-Zugriff. Alle ausgehenden Requests müssen durch authenticated Proxy, ermöglicht Logging und Policy-Enforcement.
  • Separate Auth Layers: Klare Trennung zwischen Proxy-Authentication (407 Proxy-Authenticate) und Origin-Authentication (401 WWW-Authenticate). Client kann beide Layers unabhängig handhaben.
  • Bandwidth Management: Authenticated Proxies können per-User-Quotas, Content-Filtering und Traffic-Shaping implementieren. User Accountability für Internet-Nutzung.

Spezifikation

RFC 9110, Section 15.5.8 – HTTP Semantics https://www.rfc-editor.org/rfc/rfc9110.html#name-407-proxy-authentication-re

Weitere Spezifikationen

Proxy-Authenticate Header, Proxy-Authorization Header, HTTP Status 401 - Unauthorized