L'agent AuthBasic est un agent spécial qui utilise l'authentification web basique pour authentifier dans un hôte virtuel et qui utilise ensuite les règles d'autorisation pour valider les accès à l'hôte virtuel.
L'agent envoie un en-tête WWW-Authenticate au client pour demander le couple compte-mot-de-passe et ensuite le vérifie en utilisant le service web <a1>SOAP</a1> getCookies. Lorsque la session est validée, l'agent examine les autorisations comme un agent standard.
Ce peut être pratique pour autoriser une application cliente à accéder à un hôte virtuel avec un authentifiant en envoyant un en-tête basique.
You just have to set “Type: AuthBasic” in the virtualHost options in the manager.
If you want to protect only a virtualHost part, keep type on “Main” and set type in your configuration file:
PerlSetVar VHOSTTYPE AuthBasic
fastcgi_param VHOSTTYPE = AuthBasic;
(and remove error_page 401)
Since 1.9.6, LLNG FastCGI server can handle AuthBasic handler. To call it, you just have to add fastcgi_param VHOSTTYPE AuthBasic;
in the FastCGI server call and remove error_page 401
directive:
location = /lmauth { internal; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/llng-fastcgi-server/llng-fastcgi.sock; fastcgi_param VHOSTTYPE AuthBasic; # Ignorer les données postées fastcgi_pass_request_body off; fastcgi_param CONTENT_LENGTH ""; # Conserver le nom d'hôte original fastcgi_param HOST $http_host; # Conserver la requête originale (le serveur LLNG va recevoir /llauth) fastcgi_param X_ORIGINAL_URI $request_uri; } location / { ... ###################################### # CALLING AUTHENTICATION # ###################################### auth_request /lmauth; auth_request_set $lmremote_user $upstream_http_lm_remote_user; auth_request_set $lmlocation $upstream_http_location; # Remove this for AuthBasic handler #error_page 401 $lmlocation; ... }
Aucun paramètres n'est requis. Il faut en revanche autoriser le service web des sessions, voir le backend de sessions SOAP.