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

    Function createDigestAuthorization

    • Convenience wrapper: given a raw WWW-Authenticate header from a 401 response, parse the challenge, compute the response hash, and produce the full Authorization: Digest ... header value for the retry request.

      This is the primary entry-point used by the Kinetex client's internal digest interceptor. It is also safe to use standalone in any HTTP client.

      Parameters

      • wwwAuth: string

        Raw WWW-Authenticate header value (e.g. from response.headers.get("www-authenticate")).

      • username: string

        Digest auth username.

      • password: string

        Digest auth password.

      • method: string

        HTTP method in uppercase ("GET", "POST", etc.).

      • uri: string

        Request URI path + query (e.g. "/dir/index.html").

      Returns Promise<string>

      The complete Authorization header value, ready to attach to the retry request.

      const auth = createDigestAuthorization(
      'Digest realm="testrealm@host.com", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093"',
      "Mufasa",
      "Circle Of Life",
      "GET",
      "/dir/index.html"
      );
      // "Digest username="Mufasa", realm="testrealm@host.com", ..."