Skip to main content

Module authorization

Module authorization 

Source
Expand description

Raw extraction of the sensitive Authorization field.

In addition to raw field extraction, this module can route the common Bearer and Basic schemes to borrowed credential strings. It does not validate tokens, decode Basic credentials, fully validate the Authorization grammar, or authenticate requests. Returned values are sensitive and must not be logged or echoed; extraction errors never contain them.

Standards context: the HTTP authentication framework is defined by RFC 9110 Section 11, Bearer usage by RFC 6750 Section 2.1, and Basic by RFC 7617 Section 2. The helpers here only recognize a scheme and return its raw credential string; they do not implement authentication, complete RFC syntax validation, or Basic decoding.

Functionsยง

extract_header_authorization
Extract the singular Authorization field as text.
extract_header_basic_credentials
Extract raw Basic credentials from the Authorization field.
extract_header_bearer_token
Extract raw Bearer credentials from the Authorization field.
extract_request_authorization
Extract the raw Authorization field from a complete request.
extract_request_basic_credentials
Extract raw Basic credentials from a complete request.
extract_request_bearer_token
Extract raw Bearer credentials from a complete request.