Refactor kerberos-sspi and principal handling.
This commit is contained in:
parent
3a533dd3b8
commit
524e8579d0
|
@ -122,11 +122,11 @@ class HTTPKerberosAuth(AuthBase):
|
|||
kerb_host = self.hostname_override if self.hostname_override is not None else host
|
||||
kerb_spn = "{0}@{1}".format(self.service, kerb_host)
|
||||
|
||||
kwargs = {'principal': self.principal}
|
||||
# kerberos-sspi: Never pass principal. Raise if user tries to specify one.
|
||||
if self._using_kerberos_sspi:
|
||||
kwargs = {}
|
||||
if self.principal:
|
||||
# kerberos-sspi: Never pass principal. Raise if user tries to specify one.
|
||||
if not self._using_kerberos_sspi:
|
||||
kwargs['principal'] = self.principal
|
||||
elif self.principal:
|
||||
raise NotImplementedError("Can't use 'principal' argument with kerberos-sspi.")
|
||||
|
||||
result, self.context[host] = kerberos.authGSSClientInit(kerb_spn,
|
||||
|
|
Loading…
Reference in New Issue