2 # Copyright (C) 2015 - mod_auth_gssapi contributors, see COPYING for license.
6 from requests_kerberos import HTTPKerberosAuth, OPTIONAL
9 if __name__ == '__main__':
10 sess = requests.Session()
11 url = 'http://%s/spnego/' % os.environ['NSS_WRAPPER_HOSTNAME']
14 if r.status_code != 401:
15 raise ValueError('Spnego failed - 401 expected')
17 if not (r.headers.get("WWW-Authenticate") and
18 r.headers.get("WWW-Authenticate").startswith("Negotiate")):
19 raise ValueError('Spnego failed - WWW-Authenticate Negotiate header '