Skip to content

Commit 82d74e9

Browse files
committed
Add SPNEGO Proxy Auth test
Idealy we could use Python 'requests' but I don't seem to find how to make it work. Also it would have been better to do server-auth using SPNEGO but curl loops re-using the same authz blob which gets rejected by MAG (Request is a replay). This seem resolved in recent versions but for now let the test do SPNEGO for Proxy auth only.
1 parent f81a9e0 commit 82d74e9

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

tests/httpd.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ CoreDumpDirectory /tmp
121121

122122

123123
<Location /spnego>
124+
Options +Includes
125+
AddOutputFilter INCLUDES .html
124126
AuthType GSSAPI
125127
AuthName "Login"
126128
GssapiSSLonly Off
@@ -130,7 +132,7 @@ CoreDumpDirectory /tmp
130132
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
131133
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
132134
GssapiCredStore keytab:${HTTPROOT}/http.keytab
133-
GssapiBasicAuth Off
135+
GssapiBasicAuth On
134136
GssapiAllowedMech krb5
135137
Require valid-user
136138
</Location>

tests/magtests.py

+15
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import subprocess
1212
import sys
1313
import time
14+
import shlex
1415

1516

1617
def parse_args():
@@ -273,6 +274,20 @@ def test_spnego_auth(testdir, testenv, testlog):
273274
else:
274275
sys.stderr.write('SPNEGO: SUCCESS\n')
275276

277+
curl = "curl -vf http://%s:%s@%s/spnego/ -x http://%s:%s -U: --proxy-negotiate" % (
278+
USR_NAME, USR_PWD, WRAP_HOSTNAME, WRAP_HOSTNAME, WRAP_PROXY_PORT)
279+
curl = shlex.split(curl)
280+
281+
with (open(testlog, 'a')) as logfile:
282+
spnego = subprocess.Popen(curl,
283+
stdout=logfile, stderr=logfile,
284+
env=testenv, preexec_fn=os.setsid)
285+
spnego.wait()
286+
if spnego.returncode != 0:
287+
sys.stderr.write('SPNEGO Proxy Auth: FAILED\n')
288+
else:
289+
sys.stderr.write('SPNEGO Proxy Auth: SUCCESS\n')
290+
276291

277292
def test_basic_auth_krb5(testdir, testenv, testlog):
278293

0 commit comments

Comments
 (0)