HTTP Proxy-Authorization Header

Der HTTP-Header Proxy-Authorization ist ein Request-Header, der Authentifizierungs-Credentials des Clients an einen Proxy-Server sendet. Er wird nach einer 407 Proxy Authentication Required Antwort verwendet, um sich gegenüber dem Proxy zu authentifizieren.

Typ

Request-Header

Syntax

Der Header enthält Authentifizierungs-Schema und encodierte Credentials.

http
Proxy-Authorization: Basic dXNlcjpwYXNzd29yZA==
Proxy-Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Direktiven

Die Direktiven definieren Authentifizierungsmethode und Credentials für Proxy-Server.

Basic <credentials>
Base64-encodierter String im Format username:password. Nicht sicher ohne HTTPS/TLS.
Bearer <token>
OAuth 2.0 Access Token oder JWT für token-basierte Proxy-Authentifizierung.
Digest <parameters>
Digest Authentication mit Challenge-Response-Mechanismus (selten bei Proxies).

Beispiele

Nachfolgend finden Sie praktische Anwendungsbeispiele für den Proxy-Authorization-Header.

Beispiel 1 Basic Proxy-Authentifizierung nach 407

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

Proxy fordert Authentication.

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

Client sendet Credentials.

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

Proxy validiert und leitet Request weiter.

Beispiel 2 Bearer Token für API Gateway Proxy

http
GET /api/protected/users HTTP/1.1
Host: api.example.com
Proxy-Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJwcm94eV91c2VyIn0...
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhcGlfdXNlciJ9...

Separates Token für Proxy-Gateway und Backend-API-Server.

Beispiel 3 Wiederholte Requests mit gecachten Credentials

http
GET /api/orders HTTP/1.1
Host: api.example.com
Proxy-Authorization: Basic am9obi5kb2U6c2VjdXJlMTIz

GET /api/products HTTP/1.1
Host: api.example.com
Proxy-Authorization: Basic am9obi5kb2U6c2VjdXJlMTIz

Client sendet Proxy-Credentials bei jedem Request durch den Proxy automatisch mit.

Proxy Authorization Flow

Proxy-Authorization Authentifizierungsfluss

Vorteile für die Systemarchitektur

Proxy-Level Authentication bietet Netzwerk- und Gateway-Sicherheit vor API-Zugriff.

  • Doppelte Authentifizierung: Proxy-Auth + API-Auth für Defense-in-Depth-Strategie
  • Centralized Access Control: Corporate Proxies können Zugriff zentral steuern
  • Credential-Trennung: Proxy-Credentials sind unabhängig von API-Credentials

Spezifikation

RFC 9110, Section 11.7.2 – HTTP Semantics https://www.rfc-editor.org/rfc/rfc9110.html#name-proxy-authorization

Weitere Spezifikationen

Proxy-Authenticate Header, Authorization Header