Hi Arnaud,
the easiest way would be using OMD (nightly) where you can just switch that feature on by running "omd config".
If you don't want to do that, its just a bit of apache vodoo:
The demo system uses this apache config:
<LocationMatch /thruk>
AuthName "Thruk Demo"
AuthType Basic
AuthUserFile /home/thruk/Thruk/htpasswd.users
order allow,deny
allow from all
require valid-user
</LocationMatch>
RewriteMap users prg:/home/thruk/Thruk/script/thruk_auth
# make all cookies accessible by the url
RewriteCond %{REQUEST_URI} !^/thruk/cgi-bin/restricted.cgi
RewriteCond %{HTTP_COOKIE} (thruk_auth=[^;]+|$) [NC]
RewriteRule ^/(.*)$ /%1/%{REMOTE_ADDR}/____/$1 [C,NS]
RewriteRule ^(.*)$ ${users:$1|/loginbad/} [C,NS]
RewriteRule ^/pass/(.*)$ /$1 [NS,E=!REMOTE_USER]
RewriteRule ^/redirect/(.*)$ /$1 [NS,R=302]
RewriteRule ^/loginok/([^/]+)/(.*)$ /$2 [NS,E=REMOTE_USER:$1]
<LocationMatch ^/(?!thruk/cgi-bin/restricted.cgi)>
Order allow,deny
Allow from all
Satisfy any
</LocationMatch>
The first block enables authentication for everything and is the default. The second block rewrites the urls to go
through the thruk_auth script which decides who is authenticated and who isn't. The last block finaly removes authentication
from everything except the restricted.cgi which is used the thruk_auth script to determice if credentials are valid or not.
This method allows you to use all authentication providers of apache. You have to adjust the paths to match your installation.
Sven