kinetex - v1.0.0-rc.1
    Preparing search index...

    Function formatDigestAuth

    • Format a full Authorization: Digest ... header value from the challenge and the computed response hash.

      Only the first qop value (if multiple are offered) is used in the header — per RFC 7616 §3.4, the client chooses one.

      Parameters

      • challenge: DigestChallenge

        Parsed challenge from the 401 response.

      • username: string

        Digest auth username.

      • response: string

        Hex-encoded digest response (from computeDigestResponse).

      • uri: string

        Request URI path + query.

      • Optionalcnonce: string

        Client nonce. Auto-generated if omitted (warning: must match the value used in computeDigestResponse).

      • Optionalnc: string

        Nonce count. Defaults to "00000001" if omitted (warning: must match the value used in computeDigestResponse).

      Returns string

      The full Authorization header value, e.g. Digest username="Mufasa", realm="testrealm@host.com", ...

      const auth = formatDigestAuth(challenge, "Mufasa",
      "6629fae49393a05397450978507c4ef1",
      "/dir/index.html", "f2/wE", "00000001");