![]() |
![]()
| ![]() |
![]()
NAME
LIBRARYlibrary “libkcgi” SYNOPSIS
int
DESCRIPTIONThe
In both cases, the request is validated by base64-encoding user:password and comparing it to the given token. RETURN VALUES
EXAMPLESIn the following fragment, assume r a pointer to a struct kreq successfully initialised by khttp_parse(3). If validation is not provided, it returns an HTTP 401. The expected principle is "james", password "bond". Otherwise, it returns an HTTP 200. if (khttpbasic_validate(r, "james", "bond") <= 0) { khttp_head(r, kresps[KRESP_STATUS], "%s", khttps[KHTTP_401]); khttp_head(r, kresps[KRESP_WWW_AUTHENTICATE], "basic realm=\"%s\"", "some realm"); } else khttp_head(r, kresps[KRESP_STATUS], "%s", khttps[KHTTP_200]); SEE ALSOkcgi(3), khttp_fcgi_parse(3), khttp_parse(3), khttpdigest_validate(3) AUTHORSWritten by Kristaps Dzonsons <kristaps@bsd.lv>.
|