http_util.h File Reference

Helper functions for authentication. More...


VTM_API int vtm_http_basic_auth_require (vtm_http_res *res, const char *realm)
VTM_API int vtm_http_basic_auth_read (struct vtm_http_req *req, char **user, char **pass)

Function Documentation

VTM_API int vtm_http_basic_auth_require ( vtm_http_res *  res,
const char *  realm 

Prepares the response so that basic authentication require headers are set.

resthe response that where the headers should be set
realmrealm name for authentication
VTM_OK if the headers were successfully set
VTM_ERROR if an error occured
VTM_API int vtm_http_basic_auth_read ( struct vtm_http_req req,
char **  user,
char **  pass 

Extracts basic authentication information from the request.

User and password string must be freed by the caller.

reqthe request where the information should be extracted
[out]userwill be filled with pointer to user name
[out]passwill be filled with pointer to password
VTM_OK if the information were successfully extracted
VTM_ERROR if the information could not be retrieved