/usr/share/doc/ocsigenserver/manual-wiki/authbasic.wiki is in ocsigenserver-doc 2.2.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | =Authbasic=
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 plugins.
A very naive one is
provided as an example. See the developer's documentation if you want
to make your own one.
In order to use it, you must first add the following line to your ocsigen.conf:
{{{
<extension findlib-package="ocsigenserver.ext.authbasic"/>
}}}
This extension defines one action, {{{<authbasic>}}},
and one authentication plugin, {{{<plain>}}}.
==The {{{<authbasic>}}} action==
To add an authentication layer to a site, add the following lines before the actions defining the restricted part of your site:
{{{
<authbasic realm="...">
...
</authbasic>
}}}
The realm attribute is some name identifying the protected resource. The client is expected to send the same authentication info to all pages protected with the same realm on the same hostname.
When a request containing the right authentication token arrives, this action doesn't do anything (and therefore grants access). If the authentication info is missing, an HTTP 401 Unauthorized is immediately returned (no other extension is tried) to request the client to provide this authentication token. On most interactive browsers, this is done by popping up a dialog box asking the user for a login and a password.
The {{{<authbasic>}}} element expects one child element,
specifying which authentication plugin to use.
==The {{{<plain>}}} plugin==
To protect a resource with some fixed login and password given in the configuration file, you can use the {{{<plain>}}} plugin. Here is a self-contained example:
{{{
<authbasic realm="example">
<plain login="me" password="mypassword" />
</authbasic>
}}}
|