99from requests .structures import CaseInsensitiveDict
1010from requests .cookies import cookiejar_from_dict
1111
12- from .exceptions import MutualAuthenticationError , KerberosExchangeError
12+ from .exceptions import MutualAuthenticationError , SPNEGOExchangeError
1313
1414log = logging .getLogger (__name__ )
1515
@@ -95,9 +95,9 @@ def __init__(self, mutual_authentication=REQUIRED, service="HTTP",
9595
9696 def generate_request_header (self , response , host , is_preemptive = False ):
9797 """
98- Generates the GSSAPI authentication token with kerberos.
98+ Generates the GSSAPI authentication token
9999
100- If any GSSAPI step fails, raise KerberosExchangeError
100+ If any GSSAPI step fails, raise SPNEGOExchangeError
101101 with failure detail.
102102
103103 """
@@ -143,7 +143,7 @@ def generate_request_header(self, response, host, is_preemptive=False):
143143 log .exception (
144144 "generate_request_header(): {0} failed:" .format (gss_stage ))
145145 log .exception (msg )
146- raise KerberosExchangeError ("%s failed: %s" % (gss_stage , msg ))
146+ raise SPNEGOExchangeError ("%s failed: %s" % (gss_stage , msg ))
147147
148148 def authenticate_user (self , response , ** kwargs ):
149149 """Handles user authentication with GSSAPI"""
@@ -152,7 +152,7 @@ def authenticate_user(self, response, **kwargs):
152152
153153 try :
154154 auth_header = self .generate_request_header (response , host )
155- except KerberosExchangeError :
155+ except SPNEGOExchangeError :
156156 # GSS Failure, return existing response
157157 return response
158158
0 commit comments