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

Function fake_basic_authentication

modules/aaa/mod_auth_form.c:859–871  ·  view source on GitHub ↗

fake the basic authentication header if configured to do so */

Source from the content-addressed store, hash-verified

857
858/* fake the basic authentication header if configured to do so */
859static void fake_basic_authentication(request_rec *r, auth_form_config_rec *conf,
860 const char *user, const char *pw)
861{
862 if (conf->fakebasicauth) {
863 char *basic = apr_pstrcat(r->pool, user, ":", pw, NULL);
864 apr_size_t size = (apr_size_t) strlen(basic);
865 char *base64 = apr_palloc(r->pool,
866 apr_base64_encode_len(size + 1) * sizeof(char));
867 apr_base64_encode(base64, basic, size);
868 apr_table_setn(r->headers_in, "Authorization",
869 apr_pstrcat(r->pool, "Basic ", base64, NULL));
870 }
871}
872
873/**
874 * Must we use form authentication? If so, extract the cookie and run

Callers 1

authenticate_form_authnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected