package ocsigenserver
Install
Dune Dependency
Authors
Maintainers
Sources
md5=528d59a39e9bda4c628022b4f1e0951e
sha512=1b8653487722ad26c0c0bfcf820402a783018039ce8b7c749ffb57bc80eeb1234464950ee639cb951c5b3dde1b4e85a992dfbbc782d55e7c2a356ff2f28a3917
doc/authbasic/Authbasic/index.html
Module Authbasic
Source
use Lwt_log.Section.set_level in order to debug
Module Authbasic
: Basic HTTP Authentication.
This module implements Basic HTTP Authentication as described in RFC 2617. It can be used to add an authentication layer to sites with no built-in authentication (e.g. static files). Beware, passwords are transmitted in cleartext with this scheme, so the medium should be secured somehow (by e.g. SSL).
This module implements only the HTTP-related part of the protocol, and is meant to be extended with various authentication schemes. A very naive one (authentication with a single user/password, given in the configuration file) is provided.
This function registers an authentication plugin: it adds a new parser to the list of available authentication schemes.
This is only applied if you are running the server with an XML configuration file. Use the realm, auth variables otherwise.
A parser takes as argument an XML tree (corresponding to the first son of an <authbasic> element in the configuration file) and returns an authentication function f
. f
will be called for each request with the supplied user and password and should return (cooperatively) a boolean telling whether access is granted or not. Exceptions are handled the same way as for extension parsers.
The <authbasic> element must have a realm attribute, giving some identifier to the resource which is protected (several resources on the same hostname can share the same realm). This gives a general customization scheme "for free" from the point of view of plugin developers and is totally transparent to the plugin.