小编Bra*_*rad的帖子

与 Kerberos、IE、Firefox、LDAP Active Directory 的无缝 SSO

Alias /students /var/www/students

<Location /students>
  KrbServiceName HTTP
  KrbMethodNegotiate On
  KrbMethodK5Passwd On
  KrbSaveCredentials off
  KrbAuthRealms DOMAIN.LOCAL
  Krb5KeyTab /etc/httpd/keytab
  KrbAuthoritative off

  AuthType Kerberos
  AuthName "Please Login"
  AuthBasicProvider ldap
  AuthzLDAPAuthoritative on
  AuthLDAPURL "ldap://dc.domain.local:389/OU=Domain Users,DC=domain,DC=local?userPrincipalName?sub?(objectClass=*)"
  AuthLDAPBindDN "CN=ldapsearchuser,CN=Users,DC=domain,DC=local"
  AuthLDAPBindPassword ldapsearchuserpass
  require ldap-group CN=Students,CN=Users,DC=domain,DC=local
  require ldap-group CN=Staff,CN=Users,DC=domain,DC=local
</Location>
Run Code Online (Sandbox Code Playgroud)

这允许所有属于学生/教职员工 AD 组的用户访问http://intranetsite/students后面的页面,而无需指定登录凭据,前提是他们的 IE/Firefox 配置正确。

使用 userPrincipalName 而不是 sAMAccountName 因为 kerberos 模块将 username@REALM 传递给 ldap 模块。

现在我遇到的问题是,如果有人未经授权,他们会看到:

需要授权 此服务器无法验证您是否有权访问所请求的文档。要么您提供了错误的凭据(例如,错误的密码),要么您的浏览器不了解如何提供所需的凭据。

有谁知道如何让它弹出用户名/密码对话框,以便他们可以尝试替代凭据?在未成功获得授权后,我可以让它要求凭据的唯一方法是清除我的缓存。如果我以经过身份验证的用户身份登录到 PC,但没有获得此资源的授权,我将无法提供备用凭据(这可能是一件好事)。

php active-directory ldap kerberos apache-2.2

6
推荐指数
1
解决办法
6697
查看次数

错误标头:将缓存标头放入 htaccess 文件后 ap_headers_output_filter()

接收错误:

[调试] mod_headers.c(663): headers: ap_headers_output_filter()

在我将其包含在.htaccess文件中之后:

# 6 DAYS
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=518400, public"
</FilesMatch>
 
# 2 DAYS
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>
 
# 2 HOURS
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>
Run Code Online (Sandbox Code Playgroud)

对于我可以做些什么来解决这个问题,任何帮助表示赞赏?

linux php cache .htaccess apache-2.2

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

apache-2.2 ×2

php ×2

.htaccess ×1

active-directory ×1

cache ×1

kerberos ×1

ldap ×1

linux ×1