Skip to main content

parse_basic_credentials

Function parse_basic_credentials 

Source
pub fn parse_basic_credentials(headers: &HeaderMap) -> Option<(String, String)>
Expand description

Parse a Basic <base64(user:pass)> Authorization header into (username, password). Returns None if the header is missing, malformed, or not Basic.

Provided as a free function so user-supplied FnAuthentication closures (the recommended way to ship HTTP Basic Auth) can reach it without re-implementing the boring base64 + colon-split logic.