View Source Tesla.Middleware.DigestAuth (tesla v1.7.0)

Digest access authentication middleware.

Wiki on the topic

NOTE: Currently the implementation is incomplete and works only for MD5 algorithm and auth "quality of protection" (qop).

examples

Examples

defmodule MyClient do
  use Tesla

  def client(username, password, opts \ %{}) do
    Tesla.client([
      {Tesla.Middleware.DigestAuth, Map.merge(%{username: username, password: password}, opts)}
    ])
  end
end

options

Options

  • :username - username (defaults to "")
  • :password - password (defaults to "")
  • :cnonce_fn - custom function generating client nonce (defaults to &Tesla.Middleware.DigestAuth.cnonce/0)
  • :nc - nonce counter (defaults to "00000000")