0

我尝试了几种从 LDAP 身份验证会话中注销的可能性。他们都没有工作。我在 Centos7 上使用 Apache 2.4。有没有办法这样做?

我的最新配置如下:

<VirtualHost *:12345>

  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

  <Directory /var/www/html/logouttest>
    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

  </Directory>


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

</VirtualHost>

Apache doc 在这个主题上让我感到困惑。尤其是这条线SetHandler form-logout-handler根本不起作用。(我必须编写自己的处理程序吗?)。

无论如何,如果有人可以确认是否可以在 apache 中正确终止经过身份验证的会话,我会很高兴(有些帖子声明它是不可能的。)

4

1 回答 1

2

HTTP 基本身份验证没有注销的概念。请求要么附有您的凭据,要么不附有 - 两者之间没有任何内容。您的浏览器不会每次都提示您,但每次都会发送凭据。

您所读到的与表单相关的内容是针对一组面向会话的登录模块。这与您在这里所拥有的无关。

于 2016-01-22T18:16:56.700 回答