20#define APR_WANT_STRFUNC
38#define FORM_LOGIN_HANDLER "form-login-handler"
39#define FORM_LOGOUT_HANDLER "form-logout-handler"
40#define FORM_REDIRECT_HANDLER "form-redirect-handler"
41#define MOD_AUTH_FORM_HASH "site"
98 conf->
method =
"httpd_method";
100 conf->
body =
"httpd_body";
163 return apr_psprintf(
cmd->pool,
164 "Unknown Authn provider: %s",
170 return apr_psprintf(
cmd->pool,
171 "The '%s' Authn provider doesn't support "
198 return apr_pstrcat(
cmd->pool,
cmd->directive->directive,
199 " cannot be empty, or contain '=' or '&'.",
261 return "AuthCookieFormSize must be a size in bytes, or zero.";
278 "Could not parse login required expression '%s': %s",
295 "Could not parse login success expression '%s': %s",
312 "Could not parse logout required expression '%s': %s",
355 "specify the auth providers for a directory or location"),
357 "The field of the login form carrying the username"),
359 "The field of the login form carrying the password"),
361 "The field of the login form carrying the URL to redirect on "
362 "successful login."),
364 "The field of the login form carrying the original request method."),
366 "The field of the login form carrying the original request mimetype."),
368 "The field of the login form carrying the urlencoded original request "
371 "Maximum size of body parsed by the form parser"),
374 "If set, redirect the browser to this URL rather than "
375 "return 401 Not Authorized."),
378 "If set, redirect the browser to this URL when a login "
379 "processed by the login handler is successful."),
382 "The URL of the logout successful page. An attempt to access an "
384 "in an redirect to this page after logout."),
387 "If set, use this passphrase to determine whether the user should "
388 "be authenticated. Bypasses the user authentication check on "
389 "every website hit, and is useful for high traffic sites."),
392 "Set to 'Off' to allow access control to be passed along to "
393 "lower modules if the UserID is not known to this module"),
396 "Set to 'On' to pass through authentication to the rest of the "
397 "server as a basic authentication header."),
400 "Set to 'on' to stop the sending of a Cache-Control no-store header with "
401 "the login screen. This allows the browser to cache the credentials, but "
402 "at the risk of it being possible for the login form to be resubmitted "
403 "and revealed to the backend server through XSS. Use at own risk."),
407module AP_MODULE_DECLARE_DATA auth_form_module;
434 const char *user,
const char *
pw,
435 const char *
method,
const char *mimetype)
472 const char **user,
const char **
pw,
473 const char **
method,
const char **mimetype)
504 r->
user = (
char *) *user;
508 "from notes: user: %s, pw: %s, method: %s, mimetype: %s",
509 user ? *user :
"<null>",
pw ? *
pw :
"<null>",
510 method ? *
method :
"<null>", mimetype ? *mimetype :
"<null>");
521 const char *user,
const char *
pw,
const char *site)
546 const char **user,
const char **
pw,
const char **
hash)
565 r->
user = (
char *) *user;
571 user ? *user :
"<null>",
pw ? *
pw :
"<null>",
592 const char *location,
594 const char *mimetype,
671 "from form: user: %s, pw: %s, method: %s, mimetype: %s, location: %s",
686 "form parsed, but username field '%s' was missing or empty, unauthorized",
694 "form parsed, but password field '%s' was missing or empty, unauthorized",
780 "no authn provider configured");
824 "user '%s': authentication failure for \"%s\": "
860 const char *user,
const char *
pw)
906 "form auth cannot be used for proxy "
907 "requests due to XSS risk, access denied: %s",
r->
uri);
914 "need AuthName: %s",
r->
uri);
1047 "Can't evaluate login success expression: %s",
err);
1069 "Can't evaluate login required expression: %s",
err);
1154 "Can't evaluate login success expression: %s",
err);
1172 "Can't evaluate login required expression: %s",
err);
1223 "Can't evaluate logout expression: %s",
err);
1256 "internal redirect to method '%s' and body mimetype '%s' for the "
1265 "internal redirect requested but one or all of method, mimetype or "
1266 "body are NULL: %s",
r->
uri);
1285 "You must load mod_session to enable the mod_auth_form "
1296 "You must load mod_request to enable the mod_auth_form "
1309#if AP_MODULE_MAGIC_AT_LEAST(20080403,1)
Symbol export macros and hook functions.
const char apr_size_t len
APR-UTIL Base64 Encoding.
static const char base64[]
APR general purpose library routines.
apr_size_t const unsigned char unsigned int unsigned int d
APR Standard Headers Support.
static apr_pool_t * pconf
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
void ap_hook_post_config(ap_HOOK_post_config_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
#define AP_DECLARE_MODULE(foo)
#define AP_INIT_FLAG(directive, func, mconfig, where, help)
#define AP_INIT_ITERATE(directive, func, mconfig, where, help)
void ap_hook_handler(ap_HOOK_handler_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
const char * ap_auth_name(request_rec *r)
const char * ap_auth_type(request_rec *r)
void ap_hook_note_auth_failure(ap_HOOK_note_auth_failure_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
void * ap_lookup_provider(const char *provider_group, const char *provider_name, const char *provider_version)
#define AP_AUTH_INTERNAL_PER_CONF
void ap_hook_check_user_id(ap_HOOK_check_user_id_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
request_rec * ap_sub_req_lookup_uri(const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
int ap_run_sub_req(request_rec *r)
int ap_is_initial_req(request_rec *r)
request_rec * ap_sub_req_method_uri(const char *method, const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
void ap_hook_check_authn(ap_HOOK_check_user_id_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
void ap_run_insert_filter(request_rec *r)
apr_pool_t apr_dbd_t apr_dbd_results_t ** res
#define APR_RETRIEVE_OPTIONAL_FN(name)
#define APR_OPTIONAL_FN_TYPE(name)
#define AP_EXPR_FLAG_STRING_RESULT
#define ap_expr_parse_cmd(cmd, expr, flags, err, lookup_fn)
const char * ap_expr_str_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
#define HTTP_INTERNAL_SERVER_ERROR
#define HTTP_MOVED_TEMPORARILY
#define HTTP_METHOD_NOT_ALLOWED
#define HTTP_UNAUTHORIZED
#define HTTP_TEMPORARY_REDIRECT
#define STANDARD20_MODULE_STUFF
int ap_cstr_casecmp(const char *s1, const char *s2)
#define ap_strchr_c(s, c)
int ap_parse_form_data(request_rec *r, struct ap_filter_t *f, apr_array_header_t **ptr, apr_size_t num, apr_size_t size)
const char apr_int32_t flag
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
#define apr_pcalloc(p, size)
const char const char * password
apr_int32_t apr_int32_t apr_int32_t err
Authentication and Authorization Extension for Apache.
#define AUTHN_PROVIDER_NAME_NOTE
#define AUTHN_PROVIDER_VERSION
#define AUTHN_PROVIDER_GROUP
#define AUTHN_DEFAULT_PROVIDER
static void ap_request_insert_filter(request_rec *r)
static void ap_request_remove_filter(request_rec *r)
mod_request private header file
static apr_status_t ap_session_load(request_rec *r, session_rec **z)
static apr_status_t ap_session_get(request_rec *r, session_rec *z, const char *key, const char **value)
static apr_status_t ap_session_set(request_rec *r, session_rec *z, const char *key, const char *value)
Session Module for Apache.
authn_provider_list * next
const authn_provider * provider
const char * provider_name
authn_status(* check_password)(request_rec *r, const char *user, const char *password)
struct apr_bucket_alloc_t * bucket_alloc
A structure that represents the current request.
struct ap_filter_t * output_filters
apr_bucket_brigade * kept_body
apr_table_t * err_headers_out
struct ap_filter_t * input_filters
struct ap_conf_vector_t * per_dir_config
apr_table_t * headers_out
A structure to store information for each virtual server.
char * ap_md5(apr_pool_t *p, const unsigned char *string)