Apache : logout from an LDAP authenticated session
<p>I tried several possibilites to logout from a LDAP authenticated session. None of them worked. I use Apache 2.4 on Centos7.
Is there a way to do so?</p>

<p>My latest config look like:</p>

<pre><code>&lt;VirtualHost *:12345&gt;

  Alias /logouttest /var/www/html/logouttest
  LogLevel trace
  CustomLog /var/log/httpd/access_log common
  ErrorLog  /var/log/httpd/error_log

  DocumentRoot /var/www/html/logouttest

  &lt;Directory /var/www/html/logouttest&gt;
    AllowOverride all
    Session On
    SessionCookieName session path=/

    AuthType Basic
    AuthName "logouttest"
    AuthBasicProvider ldap
    AuthLDAPURL ldap://ad.example.com:389/OU=Users,OU=Company,DC=xxxx,DC=ch?sAMAccountName?sub?(objectclass=*)
    AuthLDAPBindDN  CN=LDAPQuery,OU=services,OU=Administrative,OU=company,DC=xxxx,DC=com
    AuthLDAPBindPassword 'xxx'
    Require valid-user

    RewriteEngine On
    RewriteCond %{LA-U:REMOTE_USER} (.+)
    RewriteRule . - [E=RU:%1,NS]
    RequestHeader add X-Forwarded-User %{RU}e

  &lt;/Directory&gt;


  &lt;Location "/logout"&gt;
    Allow from all
    Satisfy Any
    #SetHandler form-logout-handler
    AuthFormLogoutLocation /logout/logout.html
    Session On
    SessionMaxAge 1
    SessionCookieName session path=/
  &lt;/Location&gt;

&lt;/VirtualHost&gt;
</code></pre>

<p>The Apache doc confuses me in this subject. Especially the line <code>SetHandler form-logout-handler</code> doesn't work at all. (Do I have to write my own handler?).</p>

<p>Anyway, I'd be glad if someone can confirm whether it's possible to properly terminate authenticated sessions in apache (Some posts declare it as not possible.)</p>