我正在尝试运行验证来自客户端的授权令牌的代码。我在一个函数中编写了这段代码:
host = 'site_address'
state = None
service_name = f'HTTP@{host}'
try:
rc, state = kerberos.authGSSServerInit(service_name)
if rc != kerberos.AUTH_GSS_COMPLETE:
return None
rc = kerberos.authGSSServerStep(state, token) <<<<< !!! ERROR !!!
if rc == kerberos.AUTH_GSS_COMPLETE:
self.kerberos_token = kerberos.authGSSServerResponse(state)
self.kerberos_user = kerberos.authGSSServerUserName(state)
return rc
elif rc == kerberos.AUTH_GSS_CONTINUE:
return kerberos.AUTH_GSS_CONTINUE
else:
return None
except kerberos.GSSError as error:
LOGGER.error('Failed to perform the token verification due to %s', error)
return None
finally:
if state:
kerberos.authGSSServerClean(state)
但是代码在rc = kerberos.authGSSServerStep(state, token)
(标记代码中的行)处失败,并出现以下错误:
GSSError: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Request ticket server HTTP/<site_address>@<realm_name> kvno 4 found in keytab but not with enctype rc4-hmac', 100005))
还将此错误扔到屏幕上:
[3302] 1547638447.877515: Failed to decrypt AP-REQ ticket: -1765328340/Request ticket server HTTP/base.testing.gc@TESTING.GC kvno 4 found in keytab but not with enctype rc4-hmac
我的问题是:为什么我会收到此消息?我在 Active Directory 中配置的用户标记为已This account supports Kerberos AES 256 bit encryption
启用,并且使用enctypekeytab
创建的文件。/crypto AES256-SHA1
为什么我的服务器(ubuntu 机器Ubuntu 18.04
上的 docker-)试图用rc4-hmac
enctype 对它进行加密?我该如何解决?
编辑也许我的问题应该是:谁告诉我enctype
应该在哪个阅读keytab
?