2020
2121(* * Authbasic: Basic HTTP authentication *)
2222
23- (* * If you want to use this extension with Ocsigen Server's configuration file,
24- + have a look at the {% <<a_manual chapter="authbasic"|manual page>>%}.
25- + If you are using Ocsigen Server as a library, use the interface described
26- + here. Each of these functions behaves exactly as its configuration file
27- counterpart.
28- + *)
23+ (* * If you want to use this extension with Ocsigen Server's configuration file,
24+ have a look at the {% <<a_manual chapter="authbasic"|manual page>>%}.
25+ If you are using Ocsigen Server as a library, use the interface described
26+ here. Each of these functions behaves exactly as its configuration file
27+ counterpart.
28+ *)
2929
3030(* *
3131This module belongs to ocamlfind package
3232 [ocsigenserver.ext.authbasic].
3333*)
3434
35+ (* * Example of use:
36+ {[
37+ let _ =
38+ Ocsigen_server.start
39+ [ Ocsigen_server.host ~regexp:".*"
40+ [ Authbasic.run ~realm:"test"
41+ ~auth:(fun u p -> Lwt.return (u = "theuser" && p = "thepassword"))
42+ ()
43+ ; Staticmod.run ~dir:"static" () ]]
44+ ]}
45+ *)
46+
3547(* * This module implements Basic HTTP Authentication as described in
3648 {{:http://www.ietf.org/rfc/rfc2617.txt}RFC 2617}. It can be used
3749 to add an authentication layer to sites with no built-in
@@ -45,7 +57,7 @@ This module belongs to ocamlfind package
4557 in the configuration file) is provided. *)
4658
4759val section : Lwt_log_core .section
48- (* * use Lwt_log.Section.set_level in order to set the log level *)
60+ (* * use [ Lwt_log.Section.set_level] in order to set the log level *)
4961
5062type auth = string -> string -> bool Lwt .t
5163
0 commit comments