我有一个需要身份验证的apache服务器,但是有些调用需要被允许.
关闭这些调用基于查询字符串,例如:
/foo/api.php?Token=123&Task=DoStuff&Result=json
我教过一个使用LocationMatch,这可以工作,所以我计算出这个配置:
<LocationMatch ^/foo/api.php\?.*(Task=DoStuff).*>
Order Allow,Deny
Allow from All
</LocationMatch>
Run Code Online (Sandbox Code Playgroud)
但这不允许我通过身份验证(意思是我得到401).如果我只是过滤^/foo/api.php我通过身份验证,但这不够严格.
任何人都知道如何配置它以检查查询字符串中的任务参数?
对于身份验证,我们使用kerberos,这是强制在整个网站这是我们的路边遏制
LoadModule auth_kerb_module modules/mod_auth_kerb.so
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
AuthType Kerberos
Require valid-user
AuthName "Kerberos Login"
KrbMethodNegotiate on
KrbMethodK5Passwd on
KrbAuthRealms FOO.LOCAL
KrbServiceName HTTP/server.foo.local@foo.LOCAL
Krb5KeyTab /etc/httpd/conf/http.keytab
Satisfy Any
Order deny,allow
Deny from all
Allow from 192.168.72.90
Allow from 192.168.72.91
Allow from 192.168.72.94
Allow from 192.168.72.95
Allow from 127.0.0.1
</Directory>
Run Code Online (Sandbox Code Playgroud)