【问题标题】:Apache : logout from an LDAP authenticated sessionApache:从 LDAP 认证会话中注销
【发布时间】:2016-01-10 20:19:28
【问题描述】:

我尝试了几种从 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 文档让我在这个主题上感到困惑。尤其是SetHandler form-logout-handler 这一行根本不起作用。 (我必须编写自己的处理程序吗?)。

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

【问题讨论】:

    标签: session logout apache2.4 mod-ldap


    【解决方案1】:

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

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

    【讨论】:

    • 感谢召集人。那么你将如何通过会话来做到这一点?我也试过这个(见上面的配置)。
    • 抱歉,对 mod_auth_form 不太了解。一般来说,如果框架/编程模型/应用服务器提供了该功能,它们会提供一个 API 来使该会话无效。
    猜你喜欢
    • 1970-01-01
    • 2013-06-06
    • 1970-01-01
    • 2018-08-27
    • 2011-09-22
    • 1970-01-01
    • 2017-01-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多