我的自定义401错误页面获取由Apache的Firefox为非IE浏览器。
我正在使用Kerberos身份validation和ldap组授权。
基本上,如果用户不在合适的组,我想要显示401错误页面。 这是适用于Firefox而不是IE浏览器。
此外,它看起来像IE浏览器试图获取资源两次,而不是Firefox获取资源一次,并显示正确的错误信息。
==> /var/log/httpd/ssl_access_log <== xxx.xx.xxx.xx - - [20/Oct/2011:11:10:25 -0400] "GET / HTTP/1.1" 401 129 ==> /var/log/httpd/ssl_request_log <== [20/Oct/2011:11:10:25 -0400] xxx.xx.xxx.xx TLSv1 AES128-SHA "GET / HTTP/1.1" 129 ==> /var/log/httpd/ssl_access_log <== xxx.xx.xxx.xx - rballest [20/Oct/2011:11:10:25 -0400] "GET / HTTP/1.1" 401 129 ==> /var/log/httpd/ssl_request_log <== [20/Oct/2011:11:10:25 -0400] xxx.xx.xxx.xx TLSv1 AES128-SHA "GET / HTTP/1.1" 129
这里是我的httpd conf中的相关行:
<Directory "/"> Order Allow,Deny Allow from all # http://httpd.apache.org/docs/current/mod/core.html#authtype AuthType Kerberos KrbServiceName HTTP KrbAuthRealms REALM.DOMAIN.COM Krb5Keytab /etc/httpd/mykeytab.keytab KrbMethodNegotiate on #KrbMethodK5Passwd on KrbMethodK5Passwd off KrbSaveCredentials on # This removes the @REALM KrbLocalUserMapping on #Require valid-user # LDAP AUTH #AuthType Basic AuthBasicProvider ldap AuthName "Domain Credentials" # this authorizes users with ldap #AuthzLDAPAuthoritative on # tls port 636 # text port 389 # userPrincipalName will require user to input userid like: # [email protected] # sAMAccountName will require user to input userid like: # username AuthLDAPUrl "ldaps://adserver.subdomain.domain.com/CN=Users,DC=subdomain,DC=domain,DC=com?sAMAccountName" AuthLDAPBindDN "[email protected]" AuthLDAPBindPassword "password" AuthLDAPRemoteUserIsDN on AuthLDAPGroupAttributeIsDN on # require one of the following groups Require ldap-group CN=group1,CN=Users,DC=subdomain,DC=domain,DC=com </Directory> ErrorDocument 401 "<html><h1>Awstats Portal</h1><h2>Sorry, you don't have permission</h2>contact [email protected] for access or information</html>"
编辑:
一个更大的401错误信息没有帮助,同样的问题。 我也closures在我的IE浏览器中显示“友好的http错误消息”。 如果我使用纯粹的ldap唯一身份validation相同的401错误信息在两个浏览器显示罚款。 当我使用Kerberos只有Firefox显示错误信息。
使您的ErrorDocumentstring更长,填充空白。
Internet Explorer将忽略小于256或512个字节的自定义错误页面,具体取决于返回的代码。