MCPcopy Create free account
hub / github.com/apache/httpd / fcgi_check_authn

Function fcgi_check_authn

modules/aaa/mod_authnz_fcgi.c:806–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806static int fcgi_check_authn(request_rec *r)
807{
808 const char *fn = "fcgi_check_authn";
809 fcgi_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
810 &authnz_fcgi_module);
811 const char *password = NULL;
812 const fcgi_provider_conf *conf;
813 const char *prov;
814 const char *auth_type;
815 char rspbuf[NON200_RESPONSE_BUF_LEN + 1]; /* extra byte for '\0' */
816 apr_size_t rspbuflen = sizeof rspbuf - 1;
817 int res;
818
819 prov = dconf && dconf->name ? dconf->name : NULL;
820
821 if (!prov || !ap_cstr_casecmp(prov, "None")) {
822 return DECLINED;
823 }
824
825 auth_type = ap_auth_type(r);
826
827 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
828 APLOGNO(02516) "%s, prov %s, authoritative %s, "
829 "require-basic %s, user expr? %s type %s",
830 fn, prov,
831 dconf->authoritative ? "yes" : "no",
832 dconf->require_basic_auth ? "yes" : "no",
833 dconf->user_expr ? "yes" : "no",
834 auth_type);
835
836 if (auth_type && !ap_cstr_casecmp(auth_type, "Basic")) {
837 if ((res = ap_get_basic_auth_pw(r, &password))) {
838 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
839 APLOGNO(02517) "%s: couldn't retrieve basic auth "
840 "password", fn);
841 if (dconf->require_basic_auth) {
842 return res;
843 }
844 password = NULL;
845 }
846 }
847
848 conf = apr_hash_get(fcgi_authn_providers, prov, APR_HASH_KEY_STRING);
849 if (!conf) {
850 ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r,
851 APLOGNO(02518) "%s: can't find config for provider %s",
852 fn, prov);
853 return HTTP_INTERNAL_SERVER_ERROR;
854 }
855
856 if (APLOGrdebug(r)) {
857 log_provider_info(conf, r);
858 }
859
860 req_rsp(r, conf, password, AP_FCGI_APACHE_ROLE_AUTHENTICATOR_STR,
861 rspbuf, &rspbuflen);
862
863 if (r->status == HTTP_OK) {

Callers

nothing calls this directly

Calls 9

ap_get_module_configFunction · 0.85
ap_cstr_casecmpFunction · 0.85
ap_auth_typeFunction · 0.85
ap_get_basic_auth_pwFunction · 0.85
log_provider_infoFunction · 0.85
req_rspFunction · 0.85
ap_expr_str_execFunction · 0.85
ap_set_module_configFunction · 0.85
ap_custom_responseFunction · 0.85

Tested by

no test coverage detected