object
http_authenticate
HTTP Basic authentication parsing, generation, challenge building, and request verification helpers.
Availability:
logtalk_load(http_authenticate(loader))Author: Paulo Moura
Version: 1:0:0
Date: 2026-06-26
Compilation flags:
static, context_switching_callsRemarks:
(none)
Inherited public predicates:
Public predicates
challenge/2
Returns the single parsed Basic WWW-Authenticate challenge from a normalized HTTP response when present.
Compilation flags:
staticTemplate:
challenge(Response,Challenge)Mode and number of proofs:
challenge(+compound,-compound) - zero_or_oneparse_challenge/2
Parses one Basic challenge header field value into a normalized basic_challenge/1 term.
Compilation flags:
staticTemplate:
parse_challenge(Text,Challenge)Mode and number of proofs:
parse_challenge(++text,-compound) - one_or_errorExceptions:
Text is not a valid Basic challenge header value:domain_error(http_authenticate_header(www_authenticate),invalid(syntax))Text uses an unsupported authentication scheme:domain_error(http_authenticate_header(www_authenticate),unsupported_scheme(Scheme))Text contains a duplicated Basic challenge directive:domain_error(http_authenticate_header(www_authenticate),duplicate(Name))Text is missing a required Basic challenge directive:domain_error(http_authenticate_header(www_authenticate),missing(Name))Text contains an unexpected Basic challenge directive:domain_error(http_authenticate_header(www_authenticate),unexpected(Name))Text contains an invalid Basic challenge charset:domain_error(http_authenticate_header(www_authenticate),invalid(charset))generate_challenge/2
Generates one canonical Basic challenge header field value from a normalized basic_challenge/1 term.
Compilation flags:
staticTemplate:
generate_challenge(Challenge,HeaderValue)Mode and number of proofs:
generate_challenge(+compound,-atom) - one_or_errorExceptions:
Challenge is not a valid normalized Basic challenge term:domain_error(http_authenticate_term(challenge),Challenge)Challenge is missing a required field:domain_error(http_authenticate_term(challenge),missing(Name))Challenge contains a duplicated field:domain_error(http_authenticate_term(challenge),duplicate(Name))Challenge contains an unexpected field:domain_error(http_authenticate_term(challenge),unexpected(Name))Challenge contains an invalid field:domain_error(http_authenticate_term(challenge),invalid(Field))protect_request/4
Verifies a normalized HTTP request using a Basic verifier object and returns either continue(Request) or respond(Response).
Compilation flags:
staticTemplate:
protect_request(Request,Verifier,Action,Options)Mode and number of proofs:
protect_request(+compound,+object_identifier,-compound,+list(compound)) - one_or_errorExceptions:
Request is not a valid normalized HTTP request term:domain_error(http_request,Request)Verifier is a variable:instantiation_errorVerifier is neither a variable nor an existing object:existence_error(http_authenticate_verifier,Verifier)Verifier does not implement the Basic verifier protocol:domain_error(http_authenticate_verifier,Verifier)Options is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)An element
Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)An element
Option of the list Options is a compound term but not a valid option:domain_error(option,Option)Options contains an invalid Basic-auth status:domain_error(http_authenticate_status,Status)Options contains invalid Basic-auth headers:domain_error(http_headers,Headers)Options contains an invalid Basic-auth body:domain_error(http_body,Body)Options contains invalid Basic-auth properties:domain_error(http_properties,Properties)Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)