pub struct Authenticator { /* private fields */ }Expand description
Holds the negotiated password client for an authenticated RTSP session.
Constructed from a WWW-Authenticate challenge on a 401 response; then
Authenticator::authorization is called for every subsequent request so
that Digest nc/cnonce/response advance correctly (RFC 2326 §14 / see
docs/auth.md).
Implementations§
Source§impl Authenticator
impl Authenticator
Sourcepub fn from_challenge(
www_authenticate: &str,
credentials: Credentials,
) -> Result<Self>
pub fn from_challenge( www_authenticate: &str, credentials: Credentials, ) -> Result<Self>
Builds an authenticator from the WWW-Authenticate challenge value and
the client’s credentials.
Call this again with the fresh challenge when the server re-challenges
with stale=true, to pick up the new nonce (RFC 2326 §14).
Computes the Authorization header value for a request to uri using
method.
The uri MUST be the RTSP request URI (RFC 2326 §14). For Digest, each
call advances the nonce count; the resulting value carries response=,
realm=, nonce=, uri=, and (when qop is present) cnonce=/nc=.