class basic_auth_handler :?enable_auth_in_advance:bool -> ?skip_challenge:string option -> #key_handler ->
auth_handler
enable_auth_in_advance
: If set to true
, a quicker authentication
mode is enabled: when a request is sent out, it is checked whether
a previous request/response cycle exists that needed authentication.
If so, the same credentials are added to the request. Normally,
the request would be sent without credentials first, and only after
getting the authentication challenge the request is resent with the
credentials.
skip_challenge
: This option enables a mode so that the credentials
are added to HTTP requests even before any response has been seen
by the server.
This adds additional security risks, and may cause that
credentials are sent to servers that forge their identity.
The string
describes the URL space to which this applies (e.g.
"http://the-server/subdir"). Set the string to "*" to enable
everywhere. As no challenge is known, the realm string is
simply assumed to be "anywhere".