View Source Sippet.DigestAuth (Sippet v1.0.10)
Implements the Digest authentication protocol.
Link to this section Summary
Functions
Adds an Authorization
or Proxy-Authorization
header for a request after
receiving a 401 or 407 response. CSeq
must be updated after calling this
function.
Generates a response containing WWW-Authenticate
or Proxy-Authenticate
header for an incoming request. Use this function to answer to a request with
a 401 or 407 response.
Link to this section Types
Specs
password() :: binary()
Specs
realm() :: binary()
Specs
reason() :: term()
Specs
Specs
req_options() :: [req_option()]
Specs
Specs
resp_options() :: [resp_option()]
Specs
username() :: binary()
Link to this section Functions
make_request(outgoing_request, incoming_response, authenticate, options \\ [])
View SourceSpecs
make_request( outgoing_request :: Sippet.Message.request(), incoming_response :: Sippet.Message.response(), (realm() -> {:ok, username(), password()} | {:error, reason()}), req_options() ) :: {:ok, Sippet.Message.request()} | {:error, reason()}
Adds an Authorization
or Proxy-Authorization
header for a request after
receiving a 401 or 407 response. CSeq
must be updated after calling this
function.
incoming_response
must be an incoming 401/407 response containing a single
challenge header (either Proxy-Authenticate or WWW-Authenticate) and
outgoing_request
is the last request sent to the server. The passed
function receives the realm and should return {:ok, username, password}
or
{:error, reason}
.
Specs
make_response( incoming_request :: Sippet.Message.request(), status :: 401 | 407, realm(), resp_options() ) :: {:ok, Sippet.Message.response()}
Generates a response containing WWW-Authenticate
or Proxy-Authenticate
header for an incoming request. Use this function to answer to a request with
a 401 or 407 response.
A new nonce' will be generated to be used by the client in its response, but will expire after the time configured indicated in
nonce_timeout'.